Class: AssociateJsonb::ArelNodes::Jsonb::HashArrow
- Inherits:
-
Operator
- Object
- Arel::Nodes::InfixOperation
- Operator
- AssociateJsonb::ArelNodes::Jsonb::HashArrow
show all
- Defined in:
- lib/associate_jsonb/arel_nodes/jsonb/hash_arrow.rb
Overview
Instance Attribute Summary
Attributes inherited from Operator
#name, #relation
Instance Method Summary
collapse
Methods inherited from Operator
#initialize
Instance Method Details
#contains(value) ⇒ Object
16
17
18
|
# File 'lib/associate_jsonb/arel_nodes/jsonb/hash_arrow.rb', line 16
def contains(value)
ArelNodes::Jsonb::AtArrow.new(relation, self, value)
end
|
#intersects_with(array) ⇒ Object
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/associate_jsonb/arel_nodes/jsonb/hash_arrow.rb', line 20
def intersects_with(array)
::Arel::Nodes::InfixOperation.new(
'>',
::Arel::Nodes::NamedFunction.new(
'jsonb_array_length',
[ ArelNodes::Jsonb::DoublePipe.new(relation, self, array) ]
),
0
)
end
|
#operator ⇒ Object
8
9
10
|
# File 'lib/associate_jsonb/arel_nodes/jsonb/hash_arrow.rb', line 8
def operator
'#>'
end
|
#right_side ⇒ Object
12
13
14
|
# File 'lib/associate_jsonb/arel_nodes/jsonb/hash_arrow.rb', line 12
def right_side
::Arel::Nodes::SqlLiteral.new("'{#{name}}'")
end
|