Class: Jsonapi::QueryBuilder::BaseFilter
- Inherits:
-
Object
- Object
- Jsonapi::QueryBuilder::BaseFilter
- Defined in:
- lib/jsonapi/query_builder/base_filter.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(collection, query) ⇒ BaseFilter
constructor
A new instance of BaseFilter.
-
#results ⇒ ActiveRecord::Relation
Collection with the filter applied.
Constructor Details
#initialize(collection, query) ⇒ BaseFilter
Returns a new instance of BaseFilter.
10 11 12 13 |
# File 'lib/jsonapi/query_builder/base_filter.rb', line 10 def initialize(collection, query) @collection = collection @query = query end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
6 7 8 |
# File 'lib/jsonapi/query_builder/base_filter.rb', line 6 def collection @collection end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
6 7 8 |
# File 'lib/jsonapi/query_builder/base_filter.rb', line 6 def query @query end |
Instance Method Details
#results ⇒ ActiveRecord::Relation
Returns Collection with the filter applied.
16 17 18 |
# File 'lib/jsonapi/query_builder/base_filter.rb', line 16 def results raise NotImplementedError, "#{self.class} should implement #results" end |