Class: Sequel::SQL::SQLArray

Inherits:
Expression show all
Defined in:
lib/sequel_core/sql.rb

Overview

Represents an SQL array. Added so it is possible to deal with a ruby array of all two pairs as an SQL array instead of an ordered hash-like conditions specifier.

Instance Method Summary collapse

Methods inherited from Expression

#lit

Constructor Details

#initialize(array) ⇒ SQLArray

Create an object with the given array.



415
416
417
# File 'lib/sequel_core/sql.rb', line 415

def initialize(array)
  @array = array
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.



421
422
423
# File 'lib/sequel_core/sql.rb', line 421

def to_s(ds)
  ds.array_sql(@array)
end