Module: CSVDecision::Parse
- Defined in:
- lib/csv_decision/parse.rb
Overview
Methods to parse the decision table and return CSVDecision::Table object.
Class Method Summary collapse
-
.table(data:, options:) ⇒ CSVDecision::Table
Parse the CSV file or input data and create a new decision table object.
Class Method Details
.table(data:, options:) ⇒ CSVDecision::Table
Parse the CSV file or input data and create a new decision table object.
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/csv_decision/parse.rb', line 51 def self.table(data:, options:) table = CSVDecision::Table.new # In most cases the decision table will be loaded from a CSV file. table.file = data if Data.input_file?(data) parse_table(table: table, input: data, options: ) table.freeze rescue CSVDecision::Error => exp raise_error(file: table.file, exception: exp) end |