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 53 54 |
# File 'lib/popper/config.rb', line 44 def initialize(hash = nil) super @table = {} @hash = hash if hash hash.each do |k, v| @table[k.to_sym] = (v.is_a?(Hash) ? self.class.new(v) : v) end end end |
Instance Method Details
#rule_by_name(name) ⇒ Object
94 95 96 97 98 |
# File 'lib/popper/config.rb', line 94 def rule_by_name(name) @hash['rules'][name] rescue StandardError {} end |
#to_h ⇒ Object
56 57 58 |
# File 'lib/popper/config.rb', line 56 def to_h @hash end |