Class: Marvel::Api::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, headers:, body:) ⇒ Response

Returns a new instance of Response.



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

def initialize(status:, headers:, body:)
  @status = status
  @headers = headers
  @body = body

  parse_body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#countObject (readonly)

Returns the value of attribute count.



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

def count
  @count
end

#etagObject (readonly)

Returns the value of attribute etag.



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

def etag
  @etag
end

#headersObject (readonly)

Returns the value of attribute headers.



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

def headers
  @headers
end

#limitObject (readonly)

Returns the value of attribute limit.



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

def limit
  @limit
end

#offsetObject (readonly)

Returns the value of attribute offset.



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

def offset
  @offset
end

#resultsObject (readonly)

Returns the value of attribute results.



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

def results
  @results
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#totalObject (readonly)

Returns the value of attribute total.



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

def total
  @total
end