Module: CSVDecision::Guard

Defined in:
lib/csv_decision/guard.rb

Overview

Recognise guard column symbol expressions in input column data cells - e.g., > :column.present? or :column == 100.0.

Class Method Summary collapse

Class Method Details

.matches?(cell) ⇒ false, CSVDecision::Proc

Determine if the input cell string is recognised by this Matcher.

Parameters:

  • cell (String)

    Data row cell.

Returns:

  • (false, CSVDecision::Proc)

    Returns false if this cell is not a match; otherwise returns the CSVDecision::Proc object indicating if this is a constant or some type of function.



125
126
127
128
129
130
# File 'lib/csv_decision/guard.rb', line 125

def self.matches?(cell)
  proc = symbol_proc(cell)
  return proc if proc

  symbol_guard(cell)
end