Class: Triggerable::Rules::Rule
- Inherits:
-
Object
- Object
- Triggerable::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.
-
#name ⇒ Object
Returns the value of attribute name.
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.
6 7 8 9 10 11 |
# File 'lib/triggerable/rules/rule.rb', line 6 def initialize model, , block @model = model @condition = Conditions::Condition.build([:if]) @name = [:name] @actions = Triggerable::Actions::Action.build(block || [:do]) end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
4 5 6 |
# File 'lib/triggerable/rules/rule.rb', line 4 def actions @actions end |
#condition ⇒ Object
Returns the value of attribute condition.
4 5 6 |
# File 'lib/triggerable/rules/rule.rb', line 4 def condition @condition end |
#model ⇒ Object
Returns the value of attribute model.
4 5 6 |
# File 'lib/triggerable/rules/rule.rb', line 4 def model @model end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/triggerable/rules/rule.rb', line 4 def name @name end |