Class: Sequel::SQL::Subscript
- Inherits:
-
GenericExpression
- Object
- Expression
- GenericExpression
- Sequel::SQL::Subscript
- Defined in:
- lib/sequel_core/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 attributes to the given arguments.
-
#to_s(ds) ⇒ Object
Delegate the creation of the resulting SQL to the given dataset, since it may be database dependent.
-
#|(sub) ⇒ Object
Create a new subscript appending the given subscript(s) the the current array of subscripts.
Methods included from ComplexExpressionMethods
#extract, #sql_boolean, #sql_number, #sql_string
Methods included from StringMethods
Methods included from BooleanMethods
Methods included from OrderMethods
Methods included from CastMethods
#cast, #cast_numeric, #cast_string
Methods included from AliasMethods
Methods inherited from Expression
Constructor Details
#initialize(f, sub) ⇒ Subscript
Set the attributes to the given arguments
804 805 806 |
# File 'lib/sequel_core/sql.rb', line 804 def initialize(f, sub) @f, @sub = f, sub end |
Instance Attribute Details
#f ⇒ Object (readonly)
The SQL array column
798 799 800 |
# File 'lib/sequel_core/sql.rb', line 798 def f @f end |
#sub ⇒ Object (readonly)
The array of subscripts to use (should be an array of numbers)
801 802 803 |
# File 'lib/sequel_core/sql.rb', line 801 def sub @sub end |
Instance Method Details
#to_s(ds) ⇒ Object
Delegate the creation of the resulting SQL to the given dataset, since it may be database dependent.
816 817 818 |
# File 'lib/sequel_core/sql.rb', line 816 def to_s(ds) ds.subscript_sql(self) end |