Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/array.rb
Instance Method Summary collapse
-
#to_sql ⇒ Object
call-seq: array.to_sql -> a_string.
Instance Method Details
#to_sql ⇒ Object
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 |