Class: CSVToSqlite::Runner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Runner

Returns a new instance of Runner.



13
14
15
16
17
18
19
# File 'lib/csv_to_sqlite/runner.rb', line 13

def initialize(argv)
  @argv = argv
  @options = {
    :verbose =>     true
  }
  init_parser
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



11
12
13
# File 'lib/csv_to_sqlite/runner.rb', line 11

def arguments
  @arguments
end

#argvObject (readonly)

Returns the value of attribute argv.



7
8
9
# File 'lib/csv_to_sqlite/runner.rb', line 7

def argv
  @argv
end

#commandObject (readonly)

Returns the value of attribute command.



10
11
12
# File 'lib/csv_to_sqlite/runner.rb', line 10

def command
  @command
end

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/csv_to_sqlite/runner.rb', line 9

def options
  @options
end

#parserObject (readonly)

Returns the value of attribute parser.



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

def parser
  @parser
end

Instance Method Details

#runObject



21
22
23
24
# File 'lib/csv_to_sqlite/runner.rb', line 21

def run
  parse!
  CSVToSqlite::Parser.new(@source, @target, @options[:table], @options[:columns]).parse!
end