Something like:

```ruby
class ArrayHandler
  def self.handles?(klass)
    klass === Array
  end

  def call(attribute, value)
    # same as now
  end
end

# same as above for defining all the other handlers

class PredicateBuilder
  @handlers = []

  def append_handler(handler)
    @handlers.append(handler)
  end

  def prepend_handler(handler)
    @handlers.prepend(handler)
  end

  append_handler ArrayHandler # same for all the other handlers, called from most specific to most general

  def self.handler_for(object)
    @handlers.detect{ |handler| handler.handles?(object) }
  end
end

# below is custom user code example:

def CustomHandler # user-defined if needed
  def self.handles?(klass)
    # custom logic
  end

  def call(attribute, value)
    # custom logic
  end
end

# will be first handler to be checked against, because using `prepend` rather than `append`
PredicateBuilder.prepend_handler(CustomHandler)