Class: Bali::Rule

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#conditionalObject

Returns the value of attribute conditional.



7
8
9
# File 'lib/bali/rule.rb', line 7

def conditional
  @conditional
end

#operationObject (readonly)

Returns the value of attribute operation.



6
7
8
# File 'lib/bali/rule.rb', line 6

def operation
  @operation
end

#termObject (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

Returns:

  • (Boolean)


14
15
16
# File 'lib/bali/rule.rb', line 14

def conditional?
  @is_conditional ||= !!conditional
end