Class: Itiel::Extract::CSVFile
- Inherits:
-
Object
- Object
- Itiel::Extract::CSVFile
- Includes:
- ChainedStep, Nameable
- Defined in:
- lib/itiel/extract/csv_file.rb
Overview
Instance Attribute Summary collapse
-
#file_name ⇒ Object
Returns the value of attribute file_name.
Attributes included from Nameable
Attributes included from ChainedStep
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(file_name) ⇒ CSVFile
constructor
A new instance of CSVFile.
Methods included from ChainedStep
Constructor Details
#initialize(file_name) ⇒ CSVFile
Returns a new instance of CSVFile.
21 22 23 |
# File 'lib/itiel/extract/csv_file.rb', line 21 def initialize(file_name) self.file_name = file_name end |
Instance Attribute Details
#file_name ⇒ Object
Returns the value of attribute file_name.
19 20 21 |
# File 'lib/itiel/extract/csv_file.rb', line 19 def file_name @file_name end |
Instance Method Details
#extract ⇒ Object
25 26 27 28 |
# File 'lib/itiel/extract/csv_file.rb', line 25 def extract lines = CSV.read(self.file_name, :headers => true) lines.collect(&:to_hash) end |