Module: CSVDecision2::Decide Private
- Defined in:
- lib/csv_decision2/decide.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.
Main module for searching the decision table looking for one or more matches
Class Method Summary collapse
-
.decide(table:, input:,
symbolize_keys:) ⇒ Hash
private
Main method for making decisions.
Class Method Details
.decide(table:, input:, symbolize_keys:) ⇒ Hash
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.
Main method for making decisions.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/csv_decision2/decide.rb', line 18 def self.decide(table:, input:, symbolize_keys:) # Parse and transform the hash supplied as input hash, scan_cols, keys = Input.parse(table: table, input: input, symbolize_keys: symbolize_keys) # The decision object collects the results of the search and # calculates the final result decision = Decision.new(table: table, input: hash) if table.index decision.index(table: table, hash: hash, scan_cols: scan_cols, keys: keys) else decision.scan(table: table, hash: hash, scan_cols: scan_cols) end end |