Class: Request

Inherits:
Object
  • Object
show all
Defined in:
lib/primate/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request, helpers) ⇒ Request

Returns a new instance of Request.



10
11
12
13
14
15
16
17
# File 'lib/primate/request.rb', line 10

def initialize(request, helpers)
  @url = Primate::URL.new(request['url'])
  @body = RequestBody.new(request['body'], helpers)
  @path = RequestBag.new(request['path'], helpers)
  @query = RequestBag.new(request['query'], helpers)
  @headers = RequestBag.new(request['headers'], helpers)
  @cookies = RequestBag.new(request['cookies'], helpers)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



8
9
10
# File 'lib/primate/request.rb', line 8

def body
  @body
end

#cookiesObject (readonly)

Returns the value of attribute cookies.



8
9
10
# File 'lib/primate/request.rb', line 8

def cookies
  @cookies
end

#headersObject (readonly)

Returns the value of attribute headers.



8
9
10
# File 'lib/primate/request.rb', line 8

def headers
  @headers
end

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/primate/request.rb', line 8

def path
  @path
end

#queryObject (readonly)

Returns the value of attribute query.



8
9
10
# File 'lib/primate/request.rb', line 8

def query
  @query
end

#urlObject (readonly)

Returns the value of attribute url.



8
9
10
# File 'lib/primate/request.rb', line 8

def url
  @url
end