Class: RideBuilder::Affiliate::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/ridebuilder/affiliate/transport.rb

Overview

A completed HTTP response — any status. Non-2xx is returned here, not raised.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



13
14
15
# File 'lib/ridebuilder/affiliate/transport.rb', line 13

def body
  @body
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



13
14
15
# File 'lib/ridebuilder/affiliate/transport.rb', line 13

def status
  @status
end

Instance Method Details

#jsonObject



14
15
16
17
18
19
20
# File 'lib/ridebuilder/affiliate/transport.rb', line 14

def json
  return nil if body.nil? || body.empty?

  JSON.parse(body)
rescue JSON::ParserError
  nil
end