Class: Qreds::CatchAllFunctor
- Defined in:
- lib/qreds/catch_all_functor.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(query, value, context, key, config) ⇒ CatchAllFunctor
constructor
A new instance of CatchAllFunctor.
Constructor Details
#initialize(query, value, context, key, config) ⇒ CatchAllFunctor
Returns a new instance of CatchAllFunctor.
8 9 10 11 12 13 |
# File 'lib/qreds/catch_all_functor.rb', line 8 def initialize(query, value, context, key, config) super(query, value, context) @key = key @config = config end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/qreds/catch_all_functor.rb', line 15 def call head, _, tail = key.rpartition('_') operator = map_operator(tail) attr_name = operator.nil? ? key : head config.default_lambda.call(query, attr_name, value, operator, context) end |