Module: CSVConv

Defined in:
lib/csvconv.rb,
lib/csvconv/parser.rb,
lib/csvconv/version.rb,
lib/csvconv/converter.rb,
lib/csvconv/formatter.rb

Overview

CSV converter

Defined Under Namespace

Modules: Formatter, Parser Classes: Converter

Constant Summary collapse

VERSION =
'0.0.2'

Class Method Summary collapse

Class Method Details

.csv2json(input, options) ⇒ Object



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

def csv2json(input, options)
  cv = Converter.new(:json, options)
  cv.convert(input)
end

.csv2ltsv(input, options) ⇒ Object



18
19
20
21
# File 'lib/csvconv.rb', line 18

def csv2ltsv(input, options)
  cv = Converter.new(:ltsv, options)
  cv.convert(input)
end

.csv2yaml(input, options) ⇒ Object



13
14
15
16
# File 'lib/csvconv.rb', line 13

def csv2yaml(input, options)
  cv = Converter.new(:yaml, options)
  cv.convert(input)
end