Class: CSVDecision::Matchers::Symbol Private
- Defined in:
- lib/csv_decision/matchers/symbol.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Match cell against a symbolic expression - e.g., :column, > :column
Class Method Summary collapse
-
.matches?(cell) ⇒ false, CSVDecision::Proc
private
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.
Instance Method Summary collapse
-
#matches?(cell) ⇒ false, CSVDecision::Proc
private
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.
Methods inherited from Matcher
Constructor Details
This class inherits a constructor from CSVDecision::Matchers::Matcher
Class Method Details
.matches?(cell) ⇒ false, CSVDecision::Proc
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.
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.
69 70 71 72 73 74 75 76 77 |
# File 'lib/csv_decision/matchers/symbol.rb', line 69 def self.matches?(cell) match = SYMBOL_COMPARE_RE.match(cell) return false unless match comparator = match['comparator'] || '=' name = match['name'].to_sym comparison(comparator: comparator, name: name) end |
Instance Method Details
#matches?(cell) ⇒ false, CSVDecision::Proc
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.
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.
81 82 83 |
# File 'lib/csv_decision/matchers/symbol.rb', line 81 def matches?(cell) Symbol.matches?(cell) end |