class Mobility::Backends::Sequel::Jsonb::JSONBOp

Public Instance Methods

=~(other) click to toggle source
Calls superclass method
# File lib/mobility/backends/sequel/jsonb.rb, line 56
def =~(other)
  case other
  when Integer, ::Hash
    to_dash_arrow =~ other.to_json
  when NilClass
    ~to_question
  else
    super
  end
end
to_dash_arrow() click to toggle source
# File lib/mobility/backends/sequel/jsonb.rb, line 44
def to_dash_arrow
  column = @value.args[0].value
  locale = @value.args[1]
  ::Sequel.pg_jsonb_op(column)[locale]
end
to_question() click to toggle source
# File lib/mobility/backends/sequel/jsonb.rb, line 50
def to_question
  column = @value.args[0].value
  locale = @value.args[1]
  ::Sequel.pg_jsonb_op(column).has_key?(locale)
end