Class: Racket::Request

Inherits:
Rack::Request
  • Object
show all
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

Instance Method Details

#get(key, default = nil) ⇒ Object

Returns a value from the GET parameter hash.

Parameters:

  • key (Object)
  • default (Object) (defaults to: nil)

Returns:

  • (Object)


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.

Parameters:

  • key (Object)
  • default (Object) (defaults to: nil)

Returns:

  • (Object)


51
52
53
# File 'lib/racket/request.rb', line 51

def post(key, default = nil)
  post_params.fetch(key.to_s, default)
end