Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/array.rb

Instance Method Summary collapse

Instance Method Details

#to_sqlObject

call-seq: array.to_sql -> a_string

Returns a string by collecting all elements, calling to_sql on each one, and then joins them with ‘, ’.

[10, 'book', :column2].to_sql     #=> "10, 'book', column2"


8
9
10
# File 'lib/array.rb', line 8

def to_sql
  self.collect { |element| element.to_sql }.join(', ')
end