class Wongi::Engine::BetaTest

Attributes

field[R]
variable[R]

Public Class Methods

new(field, variable) click to toggle source
# File lib/wongi-engine/beta/join_node.rb, line 6
def initialize(field, variable)
  @field = field
  @variable = variable
end

Public Instance Methods

equivalent?(other) click to toggle source
# File lib/wongi-engine/beta/join_node.rb, line 18
def equivalent?(other)
  other.field == field && other.variable == variable
end
matches?(token, wme) click to toggle source
# File lib/wongi-engine/beta/join_node.rb, line 11
def matches?(token, wme)
  assignment = token[variable]
  field = wme.send(self.field)
  # field.nil? ||
  !token.has_var?(variable) || field == assignment
end