Class: Gizmo::FindAll
- Inherits:
-
BaseOperation
- Object
- BaseOperation
- Gizmo::FindAll
- Defined in:
- lib/gizmo/find_all.rb
Instance Attribute Summary
Attributes inherited from BaseOperation
Instance Method Summary collapse
-
#call(criteria) ⇒ Gizmo::Response
Find all items using the provided criteria.
Methods inherited from BaseOperation
#create_response, #default_status, #initialize, #set_response_headers
Constructor Details
This class inherits a constructor from Gizmo::BaseOperation
Instance Method Details
#call(criteria) ⇒ Gizmo::Response
Find all items using the provided criteria.
9 10 11 12 13 14 15 |
# File 'lib/gizmo/find_all.rb', line 9 def call(criteria) response = create_response all_items = criteria.all response.header 'X-Total-Results', all_items.count response.data = all_items response end |