Class: FidorApi::Connectivity::Connection::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/fidor_api/connectivity/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



6
7
8
# File 'lib/fidor_api/connectivity/connection.rb', line 6

def headers
  @headers
end

#raw_bodyObject

Returns the value of attribute raw_body

Returns:

  • (Object)

    the current value of raw_body



6
7
8
# File 'lib/fidor_api/connectivity/connection.rb', line 6

def raw_body
  @raw_body
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



6
7
8
# File 'lib/fidor_api/connectivity/connection.rb', line 6

def status
  @status
end

Instance Method Details

#bodyObject



7
8
9
10
11
12
13
# File 'lib/fidor_api/connectivity/connection.rb', line 7

def body
  if headers["content-type"] =~ /json/
    JSON.parse(raw_body)
  else
    raw_body
  end
end