Skip to content

Add configuration support#6

Merged
phoet merged 3 commits intopenseo:masterfrom
mateuscruz:add-config-module
Aug 30, 2019
Merged

Add configuration support#6
phoet merged 3 commits intopenseo:masterfrom
mateuscruz:add-config-module

Conversation

@mateuscruz
Copy link
Copy Markdown
Contributor

This is to avoid repeating the API token every time we need a client.

Usage would look like this:

Webflow.configure do |config|
  config.api_token = 'your_api_token'
end

From this point on, any new instance of Webflow::Client will have 'your_api_token' as default.

This is to avoid repeating the API token every time we need a client.
Copy link
Copy Markdown
Contributor

@phoet phoet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the PR. This looks mostly good to me. Could you add a note to the changelog?

Comment thread lib/webflow/client.rb
@token = token
def initialize(token = nil)
@token = Webflow.config.api_token || token
@rate_limit = {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token passed should take precedence over the configuration option.

@mateuscruz
Copy link
Copy Markdown
Contributor Author

@phoet thanks for the quick review! I've made the requested changes.

@phoet phoet merged commit a3daab4 into penseo:master Aug 30, 2019
@phoet
Copy link
Copy Markdown
Contributor

phoet commented Aug 30, 2019

@mateuscruz i released a new version for this https://rubygems.org/gems/webflow-ruby/versions/0.7.0

@mateuscruz
Copy link
Copy Markdown
Contributor Author

Awesome! Thanks a lot.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants