Class: Eipiai::ApiResource

Inherits:
Webmachine::Resource show all
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_methodsObject



25
26
27
# File 'lib/eipiai/webmachine/resources/api.rb', line 25

def allowed_methods
  %w(GET)
end

#cache_headerObject



29
30
31
# File 'lib/eipiai/webmachine/resources/api.rb', line 29

def cache_header
  'public, max-age=600, s-maxage=86400'
end

#objectObject



33
34
35
# File 'lib/eipiai/webmachine/resources/api.rb', line 33

def object
  Api.new
end