Class: Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code: 200, body: '', headers: {}, cookies: {}) ⇒ Response

Returns a new instance of Response.



6
7
8
9
10
11
# File 'lib/response.rb', line 6

def initialize(code: 200, body: '', headers: {}, cookies: {})
  @code = code
  @body = body
  @headers = headers
  @cookies = cookies
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



4
5
6
# File 'lib/response.rb', line 4

def body
  @body
end

#codeObject

Returns the value of attribute code.



4
5
6
# File 'lib/response.rb', line 4

def code
  @code
end

#cookiesObject

Returns the value of attribute cookies.



4
5
6
# File 'lib/response.rb', line 4

def cookies
  @cookies
end

#headersObject

Returns the value of attribute headers.



4
5
6
# File 'lib/response.rb', line 4

def headers
  @headers
end