Class: Rules::Rule
- Inherits:
-
Object
- Object
- Rules::Rule
- Defined in:
- lib/triggerable/rules/rule.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#model ⇒ Object
Returns the value of attribute model.
Instance Method Summary collapse
-
#initialize(model, options, block) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(model, options, block) ⇒ Rule
Returns a new instance of Rule.
5 6 7 8 9 |
# File 'lib/triggerable/rules/rule.rb', line 5 def initialize model, , block @model = model @condition = Conditions::Condition.build([:if]) @actions = Triggerable::Action.build(block || [:do]) end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
3 4 5 |
# File 'lib/triggerable/rules/rule.rb', line 3 def actions @actions end |
#condition ⇒ Object
Returns the value of attribute condition.
3 4 5 |
# File 'lib/triggerable/rules/rule.rb', line 3 def condition @condition end |
#model ⇒ Object
Returns the value of attribute model.
3 4 5 |
# File 'lib/triggerable/rules/rule.rb', line 3 def model @model end |