Class: GitHub::SQL::Rows

Inherits:
Object
  • Object
show all
Defined in:
lib/github/sql/rows.rb

Overview

Internal: a list of arrays of values for insertion into SQL.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values) ⇒ Rows

Returns a new instance of Rows.



8
9
10
11
12
13
# File 'lib/github/sql/rows.rb', line 8

def initialize(values)
  unless values.all? { |v| v.is_a? Array }
    raise ArgumentError, "cannot instantiate SQL rows with anything but arrays"
  end
  @values = values.dup.freeze
end

Instance Attribute Details

#valuesObject (readonly)

Public: the Array of row values



6
7
8
# File 'lib/github/sql/rows.rb', line 6

def values
  @values
end

Instance Method Details

#inspectObject



15
16
17
# File 'lib/github/sql/rows.rb', line 15

def inspect
  "<#{self.class.name} #{values.inspect}>"
end