Class: Kraftwerk::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code: nil, body: nil, headers: {}, body_raw: false) ⇒ Response

TODO: support cookies nicely



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

def initialize(code: nil, body: nil, headers: {}, body_raw: false)
  @code = code
  @body = body
  @headers = headers
  @body_raw = body_raw
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#body_rawObject (readonly)

Returns the value of attribute body_raw.



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

def body_raw
  @body_raw
end

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#headersObject (readonly)

Returns the value of attribute headers.



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

def headers
  @headers
end