Class: Fathom::CSVImport
- Defined in:
- lib/fathom/import/csv_import.rb
Instance Attribute Summary
Attributes inherited from Import
#content, #import_node, #options
Instance Method Summary collapse
-
#import_csv ⇒ Object
it is and then parse the contents with FasterCSV.
-
#parse_options ⇒ Object
These are the options we use to parse the file.
Methods inherited from Import
Constructor Details
This class inherits a constructor from Fathom::Import
Instance Method Details
#import_csv ⇒ Object
it is and then parse the contents with FasterCSV. We assume that there are column headers that are the names of each node, and that the values in the node are values for a DataNode.
16 17 18 19 20 |
# File 'lib/fathom/import/csv_import.rb', line 16 def import_csv parsed = parse_contents extracted = extract_columns(parsed) [DataNode, extracted] end |
#parse_options ⇒ Object
These are the options we use to parse the file. They can be overriden by calling CSVImport.new(:parse_options => …, …)
24 25 26 27 28 29 |
# File 'lib/fathom/import/csv_import.rb', line 24 def return @parse_options if @parse_options @parse_options = @options[:parse_options] @parse_options ||= {:converters => [:all], :headers => true, :skip_blanks => true, :header_converters => [:strip, :symbol]} @parse_options end |