Class: AssociateJsonb::ArelNodes::Jsonb::Operator
- Inherits:
-
Arel::Nodes::InfixOperation
- Object
- Arel::Nodes::InfixOperation
- AssociateJsonb::ArelNodes::Jsonb::Operator
- Defined in:
- lib/associate_jsonb/arel_nodes/jsonb/operator.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#relation ⇒ Object
readonly
Returns the value of attribute relation.
Instance Method Summary collapse
-
#initialize(relation, left_side, key) ⇒ Operator
constructor
A new instance of Operator.
- #operator ⇒ Object
- #right_side ⇒ Object
Constructor Details
#initialize(relation, left_side, key) ⇒ Operator
Returns a new instance of Operator.
8 9 10 11 12 13 |
# File 'lib/associate_jsonb/arel_nodes/jsonb/operator.rb', line 8 def initialize(relation, left_side, key) @relation = relation @name = key super(operator, left_side, right_side) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/associate_jsonb/arel_nodes/jsonb/operator.rb', line 6 def name @name end |
#relation ⇒ Object (readonly)
Returns the value of attribute relation.
5 6 7 |
# File 'lib/associate_jsonb/arel_nodes/jsonb/operator.rb', line 5 def relation @relation end |
Instance Method Details
#operator ⇒ Object
19 20 21 22 |
# File 'lib/associate_jsonb/arel_nodes/jsonb/operator.rb', line 19 def operator raise NotImplementedError, 'Subclasses must implement an #operator method' end |
#right_side ⇒ Object
15 16 17 |
# File 'lib/associate_jsonb/arel_nodes/jsonb/operator.rb', line 15 def right_side ::Arel::Nodes::SqlLiteral.new("'#{name}'") end |