Class: ParadeDB::Arel::Nodes::FuzzyCast

Inherits:
Arel::Nodes::Node
  • Object
show all
Defined in:
lib/parade_db/arel/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expr, distance, prefix: nil, transposition_cost_one: nil) ⇒ FuzzyCast

Returns a new instance of FuzzyCast.



88
89
90
91
92
93
# File 'lib/parade_db/arel/nodes.rb', line 88

def initialize(expr, distance, prefix: nil, transposition_cost_one: nil)
  @expr = expr
  @distance = distance
  @prefix = prefix
  @transposition_cost_one = transposition_cost_one
end

Instance Attribute Details

#distanceObject (readonly)

Returns the value of attribute distance.



86
87
88
# File 'lib/parade_db/arel/nodes.rb', line 86

def distance
  @distance
end

#exprObject (readonly)

Returns the value of attribute expr.



86
87
88
# File 'lib/parade_db/arel/nodes.rb', line 86

def expr
  @expr
end

#prefixObject (readonly)

Returns the value of attribute prefix.



86
87
88
# File 'lib/parade_db/arel/nodes.rb', line 86

def prefix
  @prefix
end

#transposition_cost_oneObject (readonly)

Returns the value of attribute transposition_cost_one.



86
87
88
# File 'lib/parade_db/arel/nodes.rb', line 86

def transposition_cost_one
  @transposition_cost_one
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


99
100
101
102
103
104
105
# File 'lib/parade_db/arel/nodes.rb', line 99

def eql?(other)
  self.class == other.class &&
    expr == other.expr &&
    distance == other.distance &&
    prefix == other.prefix &&
    transposition_cost_one == other.transposition_cost_one
end

#hashObject



95
96
97
# File 'lib/parade_db/arel/nodes.rb', line 95

def hash
  [self.class, expr, distance, prefix, transposition_cost_one].hash
end