Class: TarvitHelpers::HashPresenter::WithRules::RulesHolder
- Inherits:
-
Object
- Object
- TarvitHelpers::HashPresenter::WithRules::RulesHolder
- Defined in:
- lib/tarvit-helpers/modules/hash_presenter/with_rules.rb
Instance Attribute Summary collapse
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
-
#initialize ⇒ RulesHolder
constructor
A new instance of RulesHolder.
- #rule_for(path) ⇒ Object
- #when(path, &_transform_value) ⇒ Object
Constructor Details
#initialize ⇒ RulesHolder
Returns a new instance of RulesHolder.
41 42 43 |
# File 'lib/tarvit-helpers/modules/hash_presenter/with_rules.rb', line 41 def initialize @rules = [] end |
Instance Attribute Details
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
39 40 41 |
# File 'lib/tarvit-helpers/modules/hash_presenter/with_rules.rb', line 39 def rules @rules end |
Instance Method Details
#rule_for(path) ⇒ Object
49 50 51 |
# File 'lib/tarvit-helpers/modules/hash_presenter/with_rules.rb', line 49 def rule_for(path) rules.find{|r| r.path == path } end |