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.
- #rule_by_name(name) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(hash = nil) ⇒ AccountAttributes
Returns a new instance of AccountAttributes.
44 45 46 47 48 49 50 51 52 |
# File 'lib/popper/config.rb', line 44 def initialize(hash=nil) @table = {} @hash = hash hash.each do |k,v| @table[k.to_sym] = (v.is_a?(Hash) ? self.class.new(v) : v) new_ostruct_member(k) end if hash end |
Instance Method Details
#rule_by_name(name) ⇒ Object
94 95 96 97 98 99 100 |
# File 'lib/popper/config.rb', line 94 def rule_by_name(name) begin @hash["rules"][name] rescue {} end end |
#to_h ⇒ Object
54 55 56 |
# File 'lib/popper/config.rb', line 54 def to_h @hash end |