Skip to content
This repository was archived by the owner on Jun 29, 2024. It is now read-only.

Remove requirement for passing client to models#66

Open
shalvah-gs wants to merge 1 commit intokoshilife:masterfrom
nxt-insurance:remove-client-requirement
Open

Remove requirement for passing client to models#66
shalvah-gs wants to merge 1 commit intokoshilife:masterfrom
nxt-insurance:remove-client-requirement

Conversation

@shalvah-gs
Copy link
Copy Markdown

As pointed out in #65, when you need to initialize a model, you must pass a client instance, or else you'll get an error "client is not ready":

Calendly::Event.new({ uri: }).fetch # raises an error

But there's no value to this error–to avoid it, you just need to add a boilerplate client, which is easy to forget, annoying and pointless:

Calendly::Event.new({ uri: }, Calendly::Client.new).fetch

This PR gets rid of this requirement. If no client is passed, a new client instance is created. It's what the user does most times anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant