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::Proc
object indicating if this is a constant or some type of function.
Instance Method Summary collapse
-
#matches?(cell) ⇒ Boolean
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) ⇒ 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.
If a constant expression returns a Proc of type :constant,
otherwise return false.
(see Matcher#matches?)
64 65 66 |
# File 'lib/csv_decision/matchers/constant.rb', line 64 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?
69 70 71 |
# File 'lib/csv_decision/matchers/constant.rb', line 69 def outs? true end |