Class: Kamome::Transformations::GeneralCsv
- Inherits:
-
Object
- Object
- Kamome::Transformations::GeneralCsv
- Includes:
- Cleaner
- Defined in:
- lib/kamome/transformations/general_csv.rb
Overview
Transform a GENERAL csv row to a Hash or others
Constant Summary
Constants included from Cleaner
Cleaner::TOWN_KAN_SUB_RULE, Cleaner::TOWN_SUB_RULE
Instance Method Summary collapse
- #generate_detail_model(row) ⇒ Object
-
#generate_hash(row) ⇒ Hash
Generate hash from a general csv row.
- #generate_model(row) ⇒ Object
Methods included from Cleaner
Instance Method Details
#generate_detail_model(row) ⇒ Object
20 21 22 23 |
# File 'lib/kamome/transformations/general_csv.rb', line 20 def generate_detail_model(row) attributes = generate_hash(row) ::Kamome::Models::General.new(attributes) end |
#generate_hash(row) ⇒ Hash
Generate hash from a general csv row
15 16 17 18 |
# File 'lib/kamome/transformations/general_csv.rb', line 15 def generate_hash(row) validate_row!(row) transform(row) end |