diff options
Diffstat (limited to 'lib/arel/visitors/reduce.rb')
-rw-r--r-- | lib/arel/visitors/reduce.rb | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/arel/visitors/reduce.rb b/lib/arel/visitors/reduce.rb deleted file mode 100644 index 7948758e2f..0000000000 --- a/lib/arel/visitors/reduce.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -require 'arel/visitors/visitor' - -module Arel - module Visitors - class Reduce < Arel::Visitors::Visitor - def accept object, collector - visit object, collector - end - - private - - def visit object, collector - send dispatch[object.class], object, collector - rescue NoMethodError => e - raise e if respond_to?(dispatch[object.class], true) - superklass = object.class.ancestors.find { |klass| - respond_to?(dispatch[klass], true) - } - raise(TypeError, "Cannot visit #{object.class}") unless superklass - dispatch[object.class] = dispatch[superklass] - retry - end - end - end -end |