Class: Noodles::Http::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/noodles/http/application.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/noodles/http/application.rb', line 9

def call(env)
  if rack_app = get_rack_app(env)
    rack_app.call(env)
  else
    response_not_found
  end
end

#routes(&block) ⇒ Object



17
18
19
20
# File 'lib/noodles/http/application.rb', line 17

def routes(&block)
  @router ||= Router.new
  @router.instance_eval(&block)
end