Class: Ruleby::Core::MatchContext
- Inherits:
-
Object
- Object
- Ruleby::Core::MatchContext
- 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
-
#fact ⇒ Object
readonly
Returns the value of attribute fact.
-
#match ⇒ Object
readonly
Returns the value of attribute match.
Instance Method Summary collapse
- #==(t) ⇒ Object
-
#initialize(fact, mr) ⇒ MatchContext
constructor
A new instance of MatchContext.
- #to_s ⇒ Object
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
#fact ⇒ Object (readonly)
Returns the value of attribute fact.
47 48 49 |
# File 'lib/core/utils.rb', line 47 def fact @fact end |
#match ⇒ Object (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_s ⇒ Object
55 56 57 |
# File 'lib/core/utils.rb', line 55 def to_s return @match.to_s end |