Module: Hotchoc::Client::Configuration
- Included in:
- Hotchoc
- Defined in:
- lib/hotchoc/client/configuration.rb
Constant Summary collapse
- VALID_CONFIG_KEYS =
[:api_key, :site, :hostname, :verify].freeze
- DEFAULT_API_KEY =
nil
- DEFAULT_SITE =
nil
- DEFAULT_HOSTNAME =
'hotchoc.io'
- DEFAULT_VERIFY =
true
Class Method Summary collapse
-
.extended(base) ⇒ Object
Make sure we have the default values set when we get ‘extended’.
Instance Method Summary collapse
Class Method Details
.extended(base) ⇒ Object
Make sure we have the default values set when we get ‘extended’
21 22 23 |
# File 'lib/hotchoc/client/configuration.rb', line 21 def self.extended(base) base.reset end |
Instance Method Details
#options ⇒ Object
32 33 34 |
# File 'lib/hotchoc/client/configuration.rb', line 32 def Hash[*VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten] end |
#reset ⇒ Object
25 26 27 28 29 30 |
# File 'lib/hotchoc/client/configuration.rb', line 25 def reset self.api_key = DEFAULT_API_KEY self.site = DEFAULT_SITE self.hostname = DEFAULT_HOSTNAME self.verify = DEFAULT_VERIFY end |