Class: Arel::Nodes::Jsonb::TextArray
- Inherits:
-
Node
- Object
- Node
- Arel::Nodes::Jsonb::TextArray
- Defined in:
- lib/jsonb_operations/arel/nodes.rb
Overview
Renders a Ruby array as a PostgreSQL ARRAY[‘a’, ‘b’] expression.
Instance Method Summary collapse
-
#==(other) ⇒ Object
(also: #eql?)
: (untyped other) -> bool.
-
#hash ⇒ Object
: () -> Integer.
-
#initialize(values) ⇒ TextArray
constructor
: (untyped values) -> void.
-
#values ⇒ Object
: () -> Array.
Constructor Details
#initialize(values) ⇒ TextArray
: (untyped values) -> void
74 75 76 77 |
# File 'lib/jsonb_operations/arel/nodes.rb', line 74 def initialize(values) super() @values = Array(values).map(&:to_s) #: Array[String] end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
: (untyped other) -> bool
80 81 82 83 84 |
# File 'lib/jsonb_operations/arel/nodes.rb', line 80 def ==(other) return false if !other.is_a?(TextArray) values == other.values end |
#hash ⇒ Object
: () -> Integer
88 89 90 |
# File 'lib/jsonb_operations/arel/nodes.rb', line 88 def hash values.hash end |
#values ⇒ Object
: () -> Array
69 70 71 |
# File 'lib/jsonb_operations/arel/nodes.rb', line 69 def values @values end |