Module: Omnis::Query::InstanceMethods
- Defined in:
- lib/omnis/query.rb
Instance Method Summary collapse
-
#extract ⇒ Object
extracts operators from params add the name of the param to each extracted operators.
- #fetch(name) ⇒ Object
- #initialize(input_params) ⇒ Object
Instance Method Details
#extract ⇒ Object
extracts operators from params add the name of the param to each extracted operators
70 71 72 73 74 75 76 |
# File 'lib/omnis/query.rb', line 70 def extract self.class.params.map do |k,v| v.extract(@input_params).tap do |operator| operator.opts[:param_name] = k unless operator.nil? end end.compact end |
#fetch(name) ⇒ Object
64 65 66 |
# File 'lib/omnis/query.rb', line 64 def fetch(name) self.class.params.fetch(name).extract(@input_params) end |
#initialize(input_params) ⇒ Object
60 61 62 |
# File 'lib/omnis/query.rb', line 60 def initialize(input_params) @input_params = input_params.symbolize_keys end |