Class: CSVDecision::Matchers::Constant Private
- Defined in:
- lib/csv_decision/matchers/constant.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.
Cell constant matcher - e.g., := true, = nil.
Class Method Summary collapse
-
.matches?(cell) ⇒ false, CSVDecision::Proc
private
Returns false if this cell is not a match; otherwise returns the
CSVDecision::Procobject indicating if this is a constant or some type of function.
Instance Method Summary collapse
-
#matches?(cell) ⇒ false, CSVDecision::Proc
private
If a constant expression returns a Proc of type :constant, otherwise return false.
-
#outs? ⇒ Boolean
private
Does this matcher apply to output cells?.
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.
31 32 33 34 35 36 37 38 |
# File 'lib/csv_decision/matchers/constant.rb', line 31 def self.matches?(cell) return false unless (match = EXPRESSION.match(cell)) proc = non_numeric?(match) return proc if proc numeric?(match) 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.
If a constant expression returns a Proc of type :constant,
otherwise return false.
66 67 68 |
# File 'lib/csv_decision/matchers/constant.rb', line 66 def matches?(cell) Matchers::Constant.matches?(cell) end |
#outs? ⇒ Boolean
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.
Does this matcher apply to output cells?
71 72 73 |
# File 'lib/csv_decision/matchers/constant.rb', line 71 def outs? true end |