Class: Sequel::SQL::Subscript
- Inherits:
-
GenericExpression
- Object
- Expression
- GenericExpression
- Sequel::SQL::Subscript
- Defined in:
- lib/sequel/sql.rb
Overview
Represents an SQL array access, with multiple possible arguments.
Instance Attribute Summary collapse
-
#f ⇒ Object
readonly
The SQL array column.
-
#sub ⇒ Object
readonly
The array of subscripts to use (should be an array of numbers).
Instance Method Summary collapse
-
#[](sub) ⇒ Object
Create a new
Subscript
by accessing a subarray of a multidimensional array. -
#initialize(f, sub) ⇒ Subscript
constructor
Set the array column and subscripts to the given arguments.
-
#|(sub) ⇒ Object
Create a new
Subscript
appending the given subscript(s) to the current array of subscripts.
Methods included from Postgres::HStoreOpMethods
Methods included from Postgres::RangeOpMethods
Methods included from Postgres::ArrayOpMethods
Methods included from Postgres::JSONOpMethods
Methods included from Postgres::InetOpMethods
Methods included from Postgres::PGRowOp::ExpressionMethods
Methods included from SubscriptMethods
Methods included from StringMethods
Methods included from PatternMatchMethods
Methods included from OrderMethods
Methods included from NumericMethods
Methods included from ComplexExpressionMethods
#extract, #sql_boolean, #sql_number, #sql_string
Methods included from CastMethods
#cast, #cast_numeric, #cast_string
Methods included from BooleanMethods
Methods included from AliasMethods
Methods inherited from Expression
#==, attr_reader, #eql?, #hash, inherited, #inspect, #lit, #sql_literal
Constructor Details
#initialize(f, sub) ⇒ Subscript
Set the array column and subscripts to the given arguments
1716 1717 1718 |
# File 'lib/sequel/sql.rb', line 1716 def initialize(f, sub) @f, @sub = f, sub end |
Instance Attribute Details
#f ⇒ Object (readonly)
The SQL array column
1710 1711 1712 |
# File 'lib/sequel/sql.rb', line 1710 def f @f end |
#sub ⇒ Object (readonly)
The array of subscripts to use (should be an array of numbers)
1713 1714 1715 |
# File 'lib/sequel/sql.rb', line 1713 def sub @sub end |