Module: Eipiai::CollectionResource
- Defined in:
- lib/eipiai/webmachine/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
14 15 16 |
# File 'lib/eipiai/webmachine/resources/collection.rb', line 14 def allowed_methods %w(GET POST) end |
#create_path ⇒ Object
22 23 24 |
# File 'lib/eipiai/webmachine/resources/collection.rb', line 22 def create_path singular_representer_class.new(new_object).path end |
#from_json ⇒ Object
26 27 28 |
# File 'lib/eipiai/webmachine/resources/collection.rb', line 26 def from_json new_object.save && handle_post_response end |
#post_is_create? ⇒ Boolean
18 19 20 |
# File 'lib/eipiai/webmachine/resources/collection.rb', line 18 def post_is_create? true end |