Class: Thanos::API::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_response) ⇒ Response

Returns a new instance of Response.



8
9
10
11
12
13
# File 'lib/thanos/api/response.rb', line 8

def initialize(raw_response)
  response = JSON.parse(raw_response)
  @code = response['code'].to_i
  @status = response['status']
  @data = response['data']
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'lib/thanos/api/response.rb', line 6

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



6
7
8
# File 'lib/thanos/api/response.rb', line 6

def data
  @data
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/thanos/api/response.rb', line 6

def status
  @status
end