Module: CSVDecision::Input Private
- Defined in:
- lib/csv_decision/input.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Parse the input hash.
Class Method Summary collapse
- .parse(table:, input:, symbolize_keys:) ⇒ Hash{Symbol=>Object} private
- .parse_data(table:, input:) ⇒ Hash{Symbol=>Object} private
Class Method Details
.parse(table:, input:, symbolize_keys:) ⇒ Hash{Symbol=>Object}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 16 17 18 19 20 21 |
# File 'lib/csv_decision/input.rb', line 13 def self.parse(table:, input:, symbolize_keys:) validate(input) parsed_input = parse_data(table: table, input: symbolize_keys ? input.symbolize_keys : input) parsed_input[:key] = parse_key(table: table, hash: parsed_input[:hash]) if table.index parsed_input end |
.parse_data(table:, input:) ⇒ Hash{Symbol=>Object}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 29 30 31 32 33 |
# File 'lib/csv_decision/input.rb', line 26 def self.parse_data(table:, input:) defaulted_columns = table.columns.defaults # Code path optimized for no defaults return parse_cells(table: table, input: input) if defaulted_columns.empty? parse_defaulted(table: table, input: input, defaulted_columns: defaulted_columns) end |