Module: Hobby

Includes:
Helpers
Defined in:
lib/hobby.rb,
lib/hobby/router.rb,
lib/hobby/helpers.rb,
lib/hobby/router/builder.rb

Defined Under Namespace

Modules: Helpers, Singleton Classes: Router

Constant Summary collapse

App =

to stay compatible with old code

Hobby
VERBS =
%w[DELETE GET HEAD OPTIONS PATCH POST PUT]

Instance Attribute Summary

Attributes included from Helpers

#env, #route

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#content_type, #halt, #my, #not_found, #request, #response, #router, #script_name, #status

Class Method Details

.included(app) ⇒ Object



11
12
13
14
15
# File 'lib/hobby.rb', line 11

def self.included app
  app.extend Singleton
  app.router = Router.new
  app.request, app.response = Rack::Request, Rack::Response
end

Instance Method Details

#call(env) ⇒ Object



36
37
38
# File 'lib/hobby.rb', line 36

def call env
  dup.handle env
end