Class: IActionable::Settings
- Inherits:
-
Object
- Object
- IActionable::Settings
- Defined in:
- lib/iactionable/settings.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
readonly
Returns the value of attribute settings.
Instance Method Summary collapse
- #api_key ⇒ Object
- #app_key ⇒ Object
-
#initialize(values) ⇒ Settings
constructor
A new instance of Settings.
- #version ⇒ Object
Constructor Details
#initialize(values) ⇒ Settings
Returns a new instance of Settings.
8 9 10 11 12 13 14 15 16 |
# File 'lib/iactionable/settings.rb', line 8 def initialize(values) @settings = { :app_key => values.fetch(:app_key), :api_key => values.fetch(:api_key), :version => values.fetch(:version) } rescue NoMethodError, KeyError => e raise ConfigError.new("IAction::Settings being initialized with invalid arguments") end |
Instance Attribute Details
#settings ⇒ Object (readonly)
Returns the value of attribute settings.
6 7 8 |
# File 'lib/iactionable/settings.rb', line 6 def settings @settings end |
Instance Method Details
#api_key ⇒ Object
22 23 24 |
# File 'lib/iactionable/settings.rb', line 22 def api_key @settings.fetch(:api_key) end |
#app_key ⇒ Object
18 19 20 |
# File 'lib/iactionable/settings.rb', line 18 def app_key @settings.fetch(:app_key) end |
#version ⇒ Object
26 27 28 |
# File 'lib/iactionable/settings.rb', line 26 def version @settings.fetch(:version) end |