Class: Mobility::Arel::Nodes::Jsonb

Inherits:
JsonbDashDoubleArrow
  • Object
show all
Defined in:
lib/mobility/arel/nodes/pg_ops.rb

Direct Known Subclasses

JsonbContainer

Instance Method Summary collapse

Instance Method Details

#eq(other) ⇒ Object


48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/mobility/arel/nodes/pg_ops.rb', line 48

def eq other
  case other
  when NilClass
    to_question.not
  when Integer, Array, Hash
    to_dash_arrow.eq other.to_json
  when Jsonb
    to_dash_arrow.eq other.to_dash_arrow
  when JsonbDashArrow
    to_dash_arrow.eq other
  else
    super
  end
end

#to_dash_arrowObject


40
41
42
# File 'lib/mobility/arel/nodes/pg_ops.rb', line 40

def to_dash_arrow
  JsonbDashArrow.new left, right
end

#to_questionObject


44
45
46
# File 'lib/mobility/arel/nodes/pg_ops.rb', line 44

def to_question
  JsonbQuestion.new left, right
end