Class: Arel::Nodes::TSVector

Inherits:
Node
  • Object
show all
Defined in:
lib/arel/nodes/ts_vector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute, language: nil) ⇒ TSVector

Returns a new instance of TSVector.



9
10
11
12
# File 'lib/arel/nodes/ts_vector.rb', line 9

def initialize(attribute, language: nil)
  @attribute = attribute
  @language = Arel::Nodes.build_quoted(language) if language
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



7
8
9
# File 'lib/arel/nodes/ts_vector.rb', line 7

def attribute
  @attribute
end

#languageObject (readonly)

Returns the value of attribute language.



7
8
9
# File 'lib/arel/nodes/ts_vector.rb', line 7

def language
  @language
end

Instance Method Details

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

Returns:

  • (Boolean)


18
19
20
21
22
# File 'lib/arel/nodes/ts_vector.rb', line 18

def eql? other
  self.class == other.class &&
  self.attribute == other.attribute &&
  self.language == other.language
end

#hashObject



14
15
16
# File 'lib/arel/nodes/ts_vector.rb', line 14

def hash
  [@attribute, @language].hash
end