Module: Eipiai::CollectionResource
- Defined in:
- lib/eipiai/resources/collection.rb
Overview
CollectionResource
The collection resource is the basis for a resource representing a collection of objects.
It provides basic GET and POST support.
It is the collection version of the ‘SingularResource` resource.
Instance Method Summary collapse
Instance Method Details
#allowed_methods ⇒ Object
15 16 17 |
# File 'lib/eipiai/resources/collection.rb', line 15 def allowed_methods %w(GET POST) end |
#create_path ⇒ Object
19 20 21 |
# File 'lib/eipiai/resources/collection.rb', line 19 def create_path new_object.path end |
#from_json ⇒ Object
23 24 25 26 |
# File 'lib/eipiai/resources/collection.rb', line 23 def from_json new_object.save handle_post_or_put_with_optional_content end |