Class: Marver::API::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_json) ⇒ Response

Returns a new instance of Response.



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

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



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

def data
  @data
end

#resultsObject (readonly)

Returns the value of attribute results.



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

def results
  @results
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end