Class: Pup::Application
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#router ⇒ Object
(also: #routes)
readonly
Returns the value of attribute router.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize ⇒ Application
constructor
A new instance of Application.
Constructor Details
#initialize ⇒ Application
Returns a new instance of Application.
11 12 13 |
# File 'lib/pup/application.rb', line 11 def initialize @router = Routing::Router.new end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/pup/application.rb', line 7 def path @path end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
7 8 9 |
# File 'lib/pup/application.rb', line 7 def request @request end |
#router ⇒ Object (readonly) Also known as: routes
Returns the value of attribute router.
7 8 9 |
# File 'lib/pup/application.rb', line 7 def router @router end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
7 8 9 |
# File 'lib/pup/application.rb', line 7 def verb @verb end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/pup/application.rb', line 15 def call(env) env = MethodOverride.apply_to(env) @request = Rack::Request.new(env) if router.has_routes? respond_to_request else pup_default_response end end |