class CSVDecision::Matchers::Function
Match cell against a function call
* no arguments - e.g., := present? * with arguments - e.g., :=lookup?(:table)
TODO: fully implement
Constants
- FUNCTION_CALL
Looks like a function call or symbol expressions, e.g.,
true¶ ↑
:= function(arg: symbol)
:column_name¶ ↑
- FUNCTION_RE
Function
call regular expression.
Public Class Methods
matches?(cell)
click to toggle source
# File lib/csv_decision/matchers/function.rb, line 29 def self.matches?(cell) match = FUNCTION_RE.match(cell) return false unless match # operator = match['operator']&.gsub(/\s+/, '') # name = match['name'].to_sym # args = match['args'].strip # negate = match['negate'] == Matchers::NEGATE end
new(options = {})
click to toggle source
@param options (see Parse.parse)
# File lib/csv_decision/matchers/function.rb, line 40 def initialize(options = {}) @options = options end
Public Instance Methods
matches?(cell)
click to toggle source
@param (see Matchers::Matcher#matches?
) @return (see Matchers::Matcher#matches?
)
# File lib/csv_decision/matchers/function.rb, line 46 def matches?(cell) Function.matches?(cell) end