Module: Format
- Included in:
- CSVR::App
- Defined in:
- lib/csvr/format.rb
Class Method Summary collapse
Class Method Details
.headers(headers) ⇒ Object
6 7 8 9 |
# File 'lib/csvr/format.rb', line 6 def headers(headers) headers = headers.map { |h| "#{h} TEXT"} return headers.join(",") end |
.row(row) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/csvr/format.rb', line 11 def row(row) if row.is_a? Hash values = row.values.map { |r| "'#{r}'"}.join(",") keys = row.keys.join(",") end return "(#{keys}) VALUES(#{values})" end |