Class: Redd::Client::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/redd/client.rb

Overview

Holds a returned HTTP response.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code


13
14
15
# File 'lib/redd/client.rb', line 13

def code
  @code
end

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers


13
14
15
# File 'lib/redd/client.rb', line 13

def headers
  @headers
end

#raw_bodyObject

Returns the value of attribute raw_body

Returns:

  • (Object)

    the current value of raw_body


13
14
15
# File 'lib/redd/client.rb', line 13

def raw_body
  @raw_body
end

Instance Method Details

#bodyObject


14
15
16
# File 'lib/redd/client.rb', line 14

def body
  @body ||= JSON.parse(raw_body, symbolize_names: true)
end