Class: Csv2hash
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#data_source ⇒ Object
Returns the value of attribute data_source.
-
#definition ⇒ Object
Returns the value of attribute definition.
Instance Method Summary collapse
-
#initialize(definition, data_source) ⇒ Csv2hash
constructor
A new instance of Csv2hash.
- #parse ⇒ Object
Methods included from Parser
Methods included from Validator
Constructor Details
#initialize(definition, data_source) ⇒ Csv2hash
Returns a new instance of Csv2hash.
13 14 15 |
# File 'lib/csv2hash.rb', line 13 def initialize definition, data_source @definition, @data_source = definition, data_source end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
11 12 13 |
# File 'lib/csv2hash.rb', line 11 def data @data end |
#data_source ⇒ Object
Returns the value of attribute data_source.
11 12 13 |
# File 'lib/csv2hash.rb', line 11 def data_source @data_source end |
#definition ⇒ Object
Returns the value of attribute definition.
11 12 13 |
# File 'lib/csv2hash.rb', line 11 def definition @definition end |
Instance Method Details
#parse ⇒ Object
17 18 19 20 21 22 |
# File 'lib/csv2hash.rb', line 17 def parse definition.validate! definition.default! validate_data! fill! end |