Class: Wongi::Engine::BetaTest
- Inherits:
-
Object
- Object
- Wongi::Engine::BetaTest
- Defined in:
- lib/wongi-engine/beta/join_node.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#variable ⇒ Object
readonly
Returns the value of attribute variable.
Instance Method Summary collapse
- #equivalent?(other) ⇒ Boolean
-
#initialize(field, variable) ⇒ BetaTest
constructor
A new instance of BetaTest.
- #matches?(token, wme) ⇒ Boolean
Constructor Details
#initialize(field, variable) ⇒ BetaTest
Returns a new instance of BetaTest.
9 10 11 |
# File 'lib/wongi-engine/beta/join_node.rb', line 9 def initialize field, variable @field, @variable = field, variable end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
6 7 8 |
# File 'lib/wongi-engine/beta/join_node.rb', line 6 def field @field end |
#variable ⇒ Object (readonly)
Returns the value of attribute variable.
7 8 9 |
# File 'lib/wongi-engine/beta/join_node.rb', line 7 def variable @variable end |
Instance Method Details
#equivalent?(other) ⇒ Boolean
20 21 22 |
# File 'lib/wongi-engine/beta/join_node.rb', line 20 def equivalent? other other.field == self.field && other.variable == self.variable end |
#matches?(token, wme) ⇒ Boolean
13 14 15 16 17 18 |
# File 'lib/wongi-engine/beta/join_node.rb', line 13 def matches? token, wme assignment = token[ self.variable ] field = wme.send( self.field ) #field.nil? || assignment && field == assignment end |