Module: Comma::Options
- Defined in:
- lib/comma/options.rb
Class Method Summary collapse
Class Method Details
.parse(input) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/comma/options.rb', line 7 def parse(input) return { style: input, filename: nil, csv: {} } unless input.is_a?(Hash) csv = input.dup style = csv.delete(:style) || Comma::DEFAULT_OPTIONS[:style] filename = csv.delete(:filename) csv[:write_headers] = csv[:write_headers] != 'false' if csv[:write_headers].is_a?(String) { style: style, filename: filename, csv: csv } end |