Module: Lattice::Configuration
- Included in:
- Lattice
- Defined in:
- lib/lattice/configuration.rb
Constant Summary collapse
- VALID_OPTIONS_KEYS =
i[client_id client_secret scope].freeze
Class Method Summary collapse
-
.extended(base) ⇒ Object
Sets all configuration options to their default values when this module is extended.
Instance Method Summary collapse
- #config ⇒ Object
- #configure {|_self| ... } ⇒ Object
-
#reset ⇒ Object
Resets all configuration options to the defaults.
Class Method Details
.extended(base) ⇒ Object
Sets all configuration options to their default values when this module is extended.
10 11 12 |
# File 'lib/lattice/configuration.rb', line 10 def self.extended(base) base.reset end |
Instance Method Details
#config ⇒ Object
18 19 20 21 22 |
# File 'lib/lattice/configuration.rb', line 18 def config VALID_OPTIONS_KEYS.inject({}) do |option, key| option.merge!(key => send(key)) end end |
#configure {|_self| ... } ⇒ Object
14 15 16 |
# File 'lib/lattice/configuration.rb', line 14 def configure yield self end |
#reset ⇒ Object
Resets all configuration options to the defaults.
25 26 27 28 29 |
# File 'lib/lattice/configuration.rb', line 25 def reset self.client_id = nil self.client_secret = nil self.scope = nil end |