Module: Jekyll::Airtable::Configuration
- Included in:
- Jekyll::Airtable
- Defined in:
- lib/jekyll-airtable/configuration.rb
Constant Summary collapse
- API_URL =
'https://api.airtable.com/'
- API_VERSION =
'v0'
- VALID_OPTIONS_KEYS =
An array of valid keys in the options hash
[ :endpoint, :api_version, :api_key, :base_uid ].freeze
Class Method Summary collapse
-
.extended(base) ⇒ Object
When this module is extended, set all configuration options to their default values.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block To be called from the base class.
-
#options ⇒ Object
Create a hash of options and their values.
-
#reset ⇒ Object
Reset all configuration options to defaults.
Class Method Details
.extended(base) ⇒ Object
When this module is extended, set all configuration options to their default values
18 19 20 |
# File 'lib/jekyll-airtable/configuration.rb', line 18 def self.extended(base) base.reset end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block To be called from the base class
31 32 33 |
# File 'lib/jekyll-airtable/configuration.rb', line 31 def configure yield self end |
#options ⇒ Object
Create a hash of options and their values
23 24 25 26 27 |
# File 'lib/jekyll-airtable/configuration.rb', line 23 def VALID_OPTIONS_KEYS.inject({}) do |option, key| option.merge!(key => send(key)) end end |
#reset ⇒ Object
Reset all configuration options to defaults
36 37 38 39 40 41 |
# File 'lib/jekyll-airtable/configuration.rb', line 36 def reset self.endpoint = API_URL self.api_version = API_VERSION self.api_key = nil self.base_uid = '' end |