Class: T1000::Request
- Inherits:
-
Object
- Object
- T1000::Request
- Defined in:
- lib/t-1000/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
-
#initialize(env) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(env) ⇒ Request
Returns a new instance of Request.
5 6 7 8 9 10 11 12 |
# File 'lib/t-1000/request.rb', line 5 def initialize(env) request = Rack::Request.new env @params = request.params @body = request.body.read @path = request.path @ip = request.ip @headers = env.select { |k, _| k =~ /[A-Z]+/ } end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/t-1000/request.rb', line 3 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
3 4 5 |
# File 'lib/t-1000/request.rb', line 3 def headers @headers end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
3 4 5 |
# File 'lib/t-1000/request.rb', line 3 def ip @ip end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/t-1000/request.rb', line 3 def params @params end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/t-1000/request.rb', line 3 def path @path end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
3 4 5 |
# File 'lib/t-1000/request.rb', line 3 def session @session end |