Class: MatchResult

Inherits:
Object
  • Object
show all
Defined in:
lib/cirrocumulus/pattern_matching.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule) ⇒ MatchResult

Returns a new instance of MatchResult.



2
3
4
5
6
# File 'lib/cirrocumulus/pattern_matching.rb', line 2

def initialize(rule)
  @rule = rule
  @matched_facts = []
  @parameters = nil
end

Instance Attribute Details

#matched_factsObject (readonly)

Returns the value of attribute matched_facts.



9
10
11
# File 'lib/cirrocumulus/pattern_matching.rb', line 9

def matched_facts
  @matched_facts
end

#parametersObject

Returns the value of attribute parameters.



10
11
12
# File 'lib/cirrocumulus/pattern_matching.rb', line 10

def parameters
  @parameters
end

#ruleObject (readonly)

Returns the value of attribute rule.



8
9
10
# File 'lib/cirrocumulus/pattern_matching.rb', line 8

def rule
  @rule
end

Instance Method Details

#==(other) ⇒ Object



12
13
14
# File 'lib/cirrocumulus/pattern_matching.rb', line 12

def ==(other)
  rule == other.rule && matched_facts == other.matched_facts
end