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.



50
51
52
53
# File 'lib/core/utils.rb', line 50

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

Instance Attribute Details

#factObject (readonly)

Returns the value of attribute fact.



47
48
49
# File 'lib/core/utils.rb', line 47

def fact
  @fact
end

#matchObject (readonly)

Returns the value of attribute match.



48
49
50
# File 'lib/core/utils.rb', line 48

def match
  @match
end

Instance Method Details

#==(t) ⇒ Object



59
60
61
# File 'lib/core/utils.rb', line 59

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

#to_sObject



55
56
57
# File 'lib/core/utils.rb', line 55

def to_s
  return @match.to_s
end