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.
21 22 23 |
# File 'lib/wongi-engine/beta/join_node.rb', line 21 def initialize field, variable @field, @variable = field, variable end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
18 19 20 |
# File 'lib/wongi-engine/beta/join_node.rb', line 18 def field @field end |
#variable ⇒ Object (readonly)
Returns the value of attribute variable.
19 20 21 |
# File 'lib/wongi-engine/beta/join_node.rb', line 19 def variable @variable end |
Instance Method Details
#equivalent?(other) ⇒ Boolean
32 33 34 |
# File 'lib/wongi-engine/beta/join_node.rb', line 32 def equivalent? other other.field == self.field && other.variable == self.variable end |
#matches?(token, wme) ⇒ Boolean
25 26 27 28 29 30 |
# File 'lib/wongi-engine/beta/join_node.rb', line 25 def matches? token, wme assignment = token[ self.variable ] field = wme.send( self.field ) #field.nil? || assignment && field == assignment end |