Class: Hyperdrive::HATEOAS

Inherits:
Object
  • Object
show all
Extended by:
Values
Defined in:
lib/hyperdrive/hateoas.rb

Class Method Summary collapse

Methods included from Values

default_config, default_cors_options, default_headers, definable_request_methods, http_request_methods, request_methods, supported_request_methods

Class Method Details

.call(env) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/hyperdrive/hateoas.rb', line 7

def self.call(env)
  @env = env
  if hyperdrive.resources.empty? || env['PATH_INFO'] != '/'
    raise Hyperdrive::Errors::NotFound
  end

  [200, headers, [body]]
end