Class: Racket::Request
- Inherits:
-
Rack::Request
- Object
- Rack::Request
- Racket::Request
- Defined in:
- lib/racket/request.rb
Overview
Represents an incoming request. Mostly matches Rack::Request but removes/redefines methods relating to GET/POST parameters and sessions.
Instance Method Summary collapse
-
#get(key, default = nil) ⇒ Object
Returns a value from the GET parameter hash.
-
#post(key, default = nil) ⇒ Object
Returns a value from the POST parameter hash.
Instance Method Details
#get(key, default = nil) ⇒ Object
Returns a value from the GET parameter hash.
38 39 40 |
# File 'lib/racket/request.rb', line 38 def get(key, default = nil) get_params.fetch(key.to_s, default) end |
#post(key, default = nil) ⇒ Object
Returns a value from the POST parameter hash.
51 52 53 |
# File 'lib/racket/request.rb', line 51 def post(key, default = nil) post_params.fetch(key.to_s, default) end |