Class: Rasti::Web::Endpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/rasti/web/endpoint.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Endpoint

Returns a new instance of Endpoint.



5
6
7
# File 'lib/rasti/web/endpoint.rb', line 5

def initialize(&block)
  @block = block
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
# File 'lib/rasti/web/endpoint.rb', line 9

def call(env)
  request = Request.new env
  response = Rack::Response.new
  @block.call request, response, Render.new(request, response)
  response.finish
end