Class: Arel::Nodes::JSONBAtArrow

Inherits:
JSONBOperator show all
Defined in:
lib/arel/nodes/jsonb_at_arrow.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from JSONBOperator

#name, #relation

Instance Method Summary collapse

Methods inherited from JSONBOperator

#initialize

Constructor Details

This class inherits a constructor from Arel::Nodes::JSONBOperator

Instance Method Details

#operatorObject



4
5
6
# File 'lib/arel/nodes/jsonb_at_arrow.rb', line 4

def operator
  '@>'
end

#right_sideObject



8
9
10
11
12
13
# File 'lib/arel/nodes/jsonb_at_arrow.rb', line 8

def right_side
  return name if name.is_a?(::Arel::Nodes::BindParam) ||
                 name.is_a?(::Arel::Nodes::SqlLiteral)

  ::Arel::Nodes::SqlLiteral.new("'#{name.to_json}'")
end