Class: Eipiai::ApiResource
- Inherits:
-
Webmachine::Resource
- Object
- Webmachine::Resource
- Eipiai::ApiResource
- Includes:
- Resource
- Defined in:
- lib/eipiai/webmachine/resources/api.rb
Overview
ApiResource
The base resource which can be included in regular Webmachine::Resource objects. It provides sensible defaults for a full-features REST API endpoint.
Instance Method Summary collapse
Methods included from Resource
#content_types_accepted, #content_types_provided, included, #malformed_request?, #new_object, #params, #to_hash, #to_json, #unprocessable_entity?
Instance Method Details
#allowed_methods ⇒ Object
19 20 21 |
# File 'lib/eipiai/webmachine/resources/api.rb', line 19 def allowed_methods %w(GET) end |
#cache_header ⇒ Object
23 24 25 |
# File 'lib/eipiai/webmachine/resources/api.rb', line 23 def cache_header 'public, max-age=600, s-maxage=86400' end |
#object ⇒ Object
27 28 29 |
# File 'lib/eipiai/webmachine/resources/api.rb', line 27 def object Api.new end |