Class: T1000::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/t-1000/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/t-1000/request.rb', line 3

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



3
4
5
# File 'lib/t-1000/request.rb', line 3

def headers
  @headers
end

#ipObject (readonly)

Returns the value of attribute ip.



3
4
5
# File 'lib/t-1000/request.rb', line 3

def ip
  @ip
end

#paramsObject (readonly)

Returns the value of attribute params.



3
4
5
# File 'lib/t-1000/request.rb', line 3

def params
  @params
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/t-1000/request.rb', line 3

def path
  @path
end

#sessionObject (readonly)

Returns the value of attribute session.



3
4
5
# File 'lib/t-1000/request.rb', line 3

def session
  @session
end