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_with_conditions_all?(&block) ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(hash = nil) ⇒ AccountAttributes
Returns a new instance of 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
#rule_with_conditions_all?(&block) ⇒ Boolean
70 71 72 73 74 75 76 |
# File 'lib/popper/config.rb', line 70 def rule_with_conditions_all?(&block) rules.to_h.keys.find do |rule| condition_by_rule(rule).to_h.all? do |mail_header,conditions| block.call(rule, mail_header, conditions) end end end |
#to_h ⇒ Object
38 39 40 |
# File 'lib/popper/config.rb', line 38 def to_h @hash_table end |