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
-
#initialize(f, sub) ⇒ Subscript
constructor
Set the array column and subscripts to the given arguments.
-
#|(sub) ⇒ Object
Create a new
Subscriptappending the given subscript(s) the the current array of subscripts.
Methods included from SubscriptMethods
Methods included from StringMethods
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, comparison_attrs, #eql?, #hash, #inspect, #lit, #sql_literal
Constructor Details
#initialize(f, sub) ⇒ Subscript
Set the array column and subscripts to the given arguments
1019 1020 1021 |
# File 'lib/sequel/sql.rb', line 1019 def initialize(f, sub) @f, @sub = f, sub end |
Instance Attribute Details
#f ⇒ Object (readonly)
The SQL array column
1013 1014 1015 |
# File 'lib/sequel/sql.rb', line 1013 def f @f end |
#sub ⇒ Object (readonly)
The array of subscripts to use (should be an array of numbers)
1016 1017 1018 |
# File 'lib/sequel/sql.rb', line 1016 def sub @sub end |
Instance Method Details
#|(sub) ⇒ Object
Create a new Subscript appending the given subscript(s) the the current array of subscripts.
1025 1026 1027 |
# File 'lib/sequel/sql.rb', line 1025 def |(sub) Subscript.new(@f, @sub + Array(sub)) end |