Class: Bali::Rule
- Inherits:
-
Object
- Object
- Bali::Rule
- Defined in:
- lib/bali/rule.rb
Overview
This class represents a rule.
can :delete
A rule can also contains conditional part
Instance Attribute Summary collapse
-
#conditional ⇒ Object
Returns the value of attribute conditional.
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
-
#term ⇒ Object
readonly
Returns the value of attribute term.
Instance Method Summary collapse
- #conditional? ⇒ Boolean
-
#initialize(term, operation) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(term, operation) ⇒ Rule
Returns a new instance of Rule.
9 10 11 12 |
# File 'lib/bali/rule.rb', line 9 def initialize(term, operation) @term = term @operation = operation end |
Instance Attribute Details
#conditional ⇒ Object
Returns the value of attribute conditional.
7 8 9 |
# File 'lib/bali/rule.rb', line 7 def conditional @conditional end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
6 7 8 |
# File 'lib/bali/rule.rb', line 6 def operation @operation end |
#term ⇒ Object (readonly)
Returns the value of attribute term.
5 6 7 |
# File 'lib/bali/rule.rb', line 5 def term @term end |
Instance Method Details
#conditional? ⇒ Boolean
14 15 16 |
# File 'lib/bali/rule.rb', line 14 def conditional? @is_conditional ||= !!conditional end |