lib/json_logic/operation.rb in json_logic-0.3 vs lib/json_logic/operation.rb in json_logic-0.4.0

- old
+ new

@@ -116,16 +116,16 @@ return LAMBDAS[operator.to_s].call(interpolated, data) if is_standard?(operator) send(operator, interpolated, data) end def self.is_standard?(operator) - LAMBDAS.keys.include?(operator) + LAMBDAS.key?(operator.to_s) end # Determine if values associated with operator need to be re-interpreted for each iteration(ie some kind of iterator) # or if values can just be evaluated before passing in. def self.is_iterable?(operator) - ['filter', 'some', 'all', 'none', 'in', 'map', 'reduce'].any? { |o| o == operator } + ['filter', 'some', 'all', 'none', 'in', 'map', 'reduce'].include?(operator.to_s) end def self.add_operation(operator, function) self.class.send(:define_method, operator) do |v, d| function.call(v, d)