Class: Lcms::Engine::BaseQuery
- Inherits:
-
Object
- Object
- Lcms::Engine::BaseQuery
- Defined in:
- app/queries/lcms/engine/base_query.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#call ⇒ Object
Returns: ActiveRecord relation.
-
#initialize(query, pagination = nil) ⇒ BaseQuery
constructor
query : query params (Hash or OpenStruct) pagination : pagination params, if pagination is nil whe return all results.
Constructor Details
#initialize(query, pagination = nil) ⇒ BaseQuery
query : query params (Hash or OpenStruct) pagination : pagination params, if pagination is nil whe return all results
12 13 14 15 |
# File 'app/queries/lcms/engine/base_query.rb', line 12 def initialize(query, pagination = nil) @q = OpenStruct.new(query) # rubocop:disable Style/OpenStructUse @pagination = pagination end |
Class Method Details
.call(query, pagination = nil) ⇒ Object
6 7 8 |
# File 'app/queries/lcms/engine/base_query.rb', line 6 def self.call(query, pagination = nil) new(query, pagination).call end |
Instance Method Details
#call ⇒ Object
Returns: ActiveRecord relation
18 19 20 |
# File 'app/queries/lcms/engine/base_query.rb', line 18 def call raise NotImplementedError end |