Class: RedboothRuby::Request::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/redbooth-ruby/request/response.rb

Overview

Wraps the API response parsing the json body and keeping interesting headers

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Response

Returns a new instance of Response.



8
9
10
11
12
13
# File 'lib/redbooth-ruby/request/response.rb', line 8

def initialize(attrs={})
  @body = attrs[:body]
  @headers = attrs[:headers]
  @status = attrs[:status]
  initialize_data
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



6
7
8
# File 'lib/redbooth-ruby/request/response.rb', line 6

def body
  @body
end

#dataObject

Returns the value of attribute data.



6
7
8
# File 'lib/redbooth-ruby/request/response.rb', line 6

def data
  @data
end

#headersObject

Returns the value of attribute headers.



6
7
8
# File 'lib/redbooth-ruby/request/response.rb', line 6

def headers
  @headers
end

#statusObject

Returns the value of attribute status.



6
7
8
# File 'lib/redbooth-ruby/request/response.rb', line 6

def status
  @status
end