Class: Mobility::Backends::Sequel::Jsonb::JSONBOp
- Inherits:
-
Sequel::Postgres::JSONBOp
- Object
- Sequel::Postgres::JSONBOp
- Mobility::Backends::Sequel::Jsonb::JSONBOp
- Defined in:
- lib/mobility/backends/sequel/jsonb.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#=~(other) ⇒ Object
56 57 58 59 60 61 62 63 64 65 |
# 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 ⇒ Object
44 45 46 47 48 |
# 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 ⇒ Object
50 51 52 53 54 |
# 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 |