Class: Casino::Intersection::Match::Equivalence

Inherits:
Object
  • Object
show all
Defined in:
lib/casino/intersection/match/equivalence.rb

Direct Known Subclasses

All, Expression, Greater, Include, Recurse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value, document, field) ⇒ Equivalence

Returns a new instance of Equivalence.



7
8
9
10
11
12
# File 'lib/casino/intersection/match/equivalence.rb', line 7

def initialize(key, value, document, field)
  self.key = key
  self.document = document
  self.field = field
  self.value = value
end

Instance Attribute Details

#documentObject

Returns the value of attribute document.



5
6
7
# File 'lib/casino/intersection/match/equivalence.rb', line 5

def document
  @document
end

#fieldObject

Returns the value of attribute field.



5
6
7
# File 'lib/casino/intersection/match/equivalence.rb', line 5

def field
  @field
end

#keyObject

Returns the value of attribute key.



5
6
7
# File 'lib/casino/intersection/match/equivalence.rb', line 5

def key
  @key
end

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/casino/intersection/match/equivalence.rb', line 5

def value
  @value
end

Instance Method Details

#eligible?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/casino/intersection/match/equivalence.rb', line 14

def eligible?
  true
end

#evaluateObject



18
19
20
# File 'lib/casino/intersection/match/equivalence.rb', line 18

def evaluate
  value == field
end