Class: Timekit::Config

Inherits:
Hash
  • Object
show all
Defined in:
lib/timekit/config.rb

Constant Summary collapse

CONFIG_KEYS =
[
  :credentials,
  :app
].freeze

Instance Method Summary collapse

Instance Method Details

#[]=(key, value) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/timekit/config.rb', line 9

def []=(key, value)
  raise 'Invalid config key' unless CONFIG_KEYS.include?(key)
  raise 'Invalid config credentials' if key == :credentials &&
                                        !value.is_a?(Timekit::Authorization)

  super(key, value)
end