lib/csv_decision/matchers/numeric.rb in csv_decision-0.4.0 vs lib/csv_decision/matchers/numeric.rb in csv_decision-0.4.1
- old
+ new
@@ -25,14 +25,11 @@
}.freeze
private_constant :COMPARATORS
# (see Matcher#matches?)
def self.matches?(cell)
- match = COMPARISON.match(cell)
- return false unless match
-
- numeric_cell = Matchers.to_numeric(match['value'])
- return false unless numeric_cell
+ return false unless (match = COMPARISON.match(cell))
+ return false unless (numeric_cell = Matchers.to_numeric(match['value']))
comparator = match['comparator']
Matchers::Proc.new(type: :proc,
function: COMPARATORS[comparator].curry[numeric_cell].freeze)
end
\ No newline at end of file