Class: Arel::Nodes::TSQuery

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression, language: nil) ⇒ TSQuery

Returns a new instance of TSQuery.



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

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

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



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

def expression
  @expression
end

#languageObject (readonly)

Returns the value of attribute language.



7
8
9
# File 'lib/arel/nodes/ts_query.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_query.rb', line 18

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

#hashObject



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

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