Class: Popper::AccountAttributes
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Popper::AccountAttributes
- Defined in:
- lib/popper/config.rb
Instance Method Summary collapse
-
#initialize(hash = nil) ⇒ AccountAttributes
constructor
A new instance of AccountAttributes.
- #to_h ⇒ Object
Constructor Details
#initialize(hash = nil) ⇒ AccountAttributes
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/popper/config.rb', line 25 def initialize(hash=nil) @table = {} @hash_table = {} if hash hash.each do |k,v| @table[k.to_sym] = (v.is_a?(Hash) ? self.class.new(v) : v) @hash_table[k.to_sym] = v new_ostruct_member(k) end end end |
Instance Method Details
#to_h ⇒ Object
38 39 40 |
# File 'lib/popper/config.rb', line 38 def to_h @hash_table end |