Class: Navigable::Server::RackAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/navigable/server/rack_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint_class:) ⇒ RackAdapter

Returns a new instance of RackAdapter.



8
9
10
# File 'lib/navigable/server/rack_adapter.rb', line 8

def initialize(endpoint_class:)
  @endpoint_class = endpoint_class
end

Instance Attribute Details

#endpoint_classObject (readonly)

Returns the value of attribute endpoint_class.



6
7
8
# File 'lib/navigable/server/rack_adapter.rb', line 6

def endpoint_class
  @endpoint_class
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
# File 'lib/navigable/server/rack_adapter.rb', line 12

def call(env)
  Response.new(endpoint(request(env)).execute).to_rack_response
end