Class: GitHub::SQL::Rows

Inherits:
Object
  • Object
show all
Defined in:
lib/github/sql.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.



58
59
60
61
62
63
# File 'lib/github/sql.rb', line 58

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



56
57
58
# File 'lib/github/sql.rb', line 56

def values
  @values
end

Instance Method Details

#inspectObject



65
66
67
# File 'lib/github/sql.rb', line 65

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