Methods

Class Index [+]

Quicksearch

Sequel::SQL::Subscript

Represents an SQL array access, with multiple possible arguments.

Attributes

f[R]

The SQL array column

sub[R]

The array of subscripts to use (should be an array of numbers)

Public Class Methods

new(f, sub) click to toggle source

Set the array column and subscripts to the given arguments

      # File lib/sequel/sql.rb, line 1344
1344:       def initialize(f, sub)
1345:         @f, @sub = f, sub
1346:       end

Public Instance Methods

[](sub) click to toggle source

Create a new Subscript by accessing a subarray of a multidimensional array.

  :a.sql_subscript(2) # a[2]
  :a.sql_subscript(2)[1] # a[2][1]
      # File lib/sequel/sql.rb, line 1362
1362:       def [](sub)
1363:         Subscript.new(self, Array(sub))
1364:       end
|(sub) click to toggle source

Create a new Subscript appending the given subscript(s) the the current array of subscripts.

  :a.sql_subscript(2) # a[2]
  :a.sql_subscript(2) | 1 # a[2, 1]
      # File lib/sequel/sql.rb, line 1353
1353:       def |(sub)
1354:         Subscript.new(@f, @sub + Array(sub))
1355:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.