Module: CSVDecision::Numeric
- Defined in:
- lib/csv_decision/numeric.rb
Overview
Recognise Ruby-like numeric comparison expressions.
Class Method Summary collapse
Class Method Details
.matches?(cell) ⇒ Boolean, ...
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/csv_decision/numeric.rb', line 26 def self.matches?(cell) match = COMPARISON.match(cell) return false unless match numeric_cell = Matchers.to_numeric(match['value']) return false unless numeric_cell comparator = match['comparator'] Proc.with(type: :proc, function: COMPARATORS[comparator].curry[numeric_cell].freeze) end |