Class: FortyTwo::Configuration
- Inherits:
-
Object
- Object
- FortyTwo::Configuration
- Defined in:
- lib/fortytwo/configuration.rb
Constant Summary collapse
- AUTH_KEYS =
[:api_key, :api_secret]
Instance Method Summary collapse
-
#initialize(config_hash = nil) ⇒ Configuration
constructor
A new instance of Configuration.
- #invalid? ⇒ Boolean
Constructor Details
#initialize(config_hash = nil) ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 13 |
# File 'lib/fortytwo/configuration.rb', line 7 def initialize(config_hash = nil) if config_hash.is_a?(Hash) config_hash.each do |config_name, config_value| self.send("#{config_name}=", config_value) end end end |
Instance Method Details
#invalid? ⇒ Boolean
15 16 17 |
# File 'lib/fortytwo/configuration.rb', line 15 def invalid? AUTH_KEYS.any? { |key| send(key).nil? || send(key).empty? } end |