Class: RubyRedtail::Setting
- Inherits:
-
Object
- Object
- RubyRedtail::Setting
- Defined in:
- lib/ruby-redtail/setting.rb
Instance Method Summary collapse
-
#initialize(setting = {}, api_hash) ⇒ Setting
constructor
A new instance of Setting.
Constructor Details
#initialize(setting = {}, api_hash) ⇒ Setting
Returns a new instance of Setting.
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/ruby-redtail/setting.rb', line 3 def initialize(setting = {},api_hash) @api_hash = api_hash raise ArgumentError if setting.class != Hash setting.each do |key, value| key = key.underscore self.class.send :attr_accessor, key instance_variable_set "@#{key}", value end end |