Class: CSVDecision::Matchers::Range Private
- Defined in:
- lib/csv_decision/matchers/range.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 cells against Ruby-like range expressions or their negation - e.g., 0...10
or !a..z.
Class Method Summary collapse
-
.matches?(cell) ⇒ Boolean
private
Match a table data cell string against a Ruby-like range expression.
Instance Method Summary collapse
-
#matches?(cell) ⇒ false, CSVDecision::Proc
private
Ruby-like range expressions or their negation - e.g.,
0...10
or !a..z.
Methods inherited from Matcher
Constructor Details
This class inherits a constructor from CSVDecision::Matchers::Matcher
Class 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.
Match a table data cell string against a Ruby-like range expression.
(see Matcher#matches?)
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/csv_decision/matchers/range.rb', line 17 def self.matches?(cell) if (match = NUMERIC_RANGE.match(cell)) return range_proc(match: match, coerce: :to_numeric) end if (match = ALNUM_RANGE.match(cell)) return range_proc(match: match) end false 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.
Ruby-like range expressions or their negation - e.g., 0...10
or !a..z.
90 91 92 |
# File 'lib/csv_decision/matchers/range.rb', line 90 def matches?(cell) Range.matches?(cell) end |