Class: Eipiai::ApiResource

Inherits:
Webmachine::Resource show all
Includes:
Resource
Defined in:
lib/eipiai/webmachine/resources/api.rb

Overview

ApiResource

The API resource handles the /api endpoint, which is the main entrypoint for all HyperMedia based API requests.

Instance Method Summary collapse

Methods included from Resource

#base_uri, #content_types_accepted, #content_types_provided, #create_uri, included, #malformed_request?, #new_object, #params, #post_is_create?, #query_keys, #resource_relation, #service_available?, #to_h, #to_hal_json, #to_json, #unprocessable_entity?

Methods included from Representable

#from_hash, #path, #represented, #to_h

Instance Method Details

#allowed_methodsObject



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

def allowed_methods
  %w(GET)
end

#cache_headerObject



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

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

#objectObject



37
38
39
# File 'lib/eipiai/webmachine/resources/api.rb', line 37

def object
  Api.new
end

#top_level_relation?Boolean

Returns:

  • (Boolean)


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

def top_level_relation?
  true
end