Class: CSVDecision::Matchers::Function

Inherits:
Matcher
  • Object
show all
Defined in:
lib/csv_decision/matchers/function.rb

Overview

Match cell against a function call

* no arguments - e.g., := present?
* with arguments - e.g., :=lookup?(:table)

TODO: fully implement

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Function

Returns a new instance of Function.



14
15
16
# File 'lib/csv_decision/matchers/function.rb', line 14

def initialize(options = {})
  @options = options
end

Instance Method Details

#matches?(cell) ⇒ 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.

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.



20
21
22
# File 'lib/csv_decision/matchers/function.rb', line 20

def matches?(cell)
  CSVDecision::Function.matches?(cell)
end