Class: Ruleby::Core::MatchContext

Inherits:
Object
  • Object
show all
Defined in:
lib/core/utils.rb

Overview

This class is a wrapper for the context under which the network executes for for a given fact. It is essentially a wrapper for a fact and a partial match.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fact, mr) ⇒ MatchContext

Returns a new instance of MatchContext.



30
31
32
33
# File 'lib/core/utils.rb', line 30

def initialize(fact,mr)
  @fact = fact      
  @match = mr  
end

Instance Attribute Details

#factObject (readonly)

Returns the value of attribute fact.



27
28
29
# File 'lib/core/utils.rb', line 27

def fact
  @fact
end

#matchObject (readonly)

Returns the value of attribute match.



28
29
30
# File 'lib/core/utils.rb', line 28

def match
  @match
end

Instance Method Details

#==(t) ⇒ Object



39
40
41
# File 'lib/core/utils.rb', line 39

def ==(t)
  return t && @fact == t.fact && @match == t.match
end

#to_sObject



35
36
37
# File 'lib/core/utils.rb', line 35

def to_s
  return @match.to_s
end