Class: MarketingCloudSDK::Response

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

Direct Known Subclasses

HTTPResponse, SoapResponse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw, client) ⇒ Response

Returns a new instance of Response.



58
59
60
61
62
63
64
65
66
# File 'lib/marketingcloudsdk/client.rb', line 58

def initialize raw, client
	@client = client # keep connection with client in case we request more
	@results = []
	@raw = raw
	unpack raw
rescue => ex # all else fails return raw
	puts ex.message
	raw
end

Instance Attribute Details

#bodyObject (readonly)

not doing accessor so user, can’t update these values from response. You will see in the code some of these items are being updated via back doors and such.



44
45
46
# File 'lib/marketingcloudsdk/client.rb', line 44

def body
  @body
end

#codeObject (readonly)

not doing accessor so user, can’t update these values from response. You will see in the code some of these items are being updated via back doors and such.



44
45
46
# File 'lib/marketingcloudsdk/client.rb', line 44

def code
  @code
end

#messageObject (readonly)

not doing accessor so user, can’t update these values from response. You will see in the code some of these items are being updated via back doors and such.



44
45
46
# File 'lib/marketingcloudsdk/client.rb', line 44

def message
  @message
end

#rawObject (readonly)

not doing accessor so user, can’t update these values from response. You will see in the code some of these items are being updated via back doors and such.



44
45
46
# File 'lib/marketingcloudsdk/client.rb', line 44

def raw
  @raw
end

#request_idObject (readonly)

not doing accessor so user, can’t update these values from response. You will see in the code some of these items are being updated via back doors and such.



44
45
46
# File 'lib/marketingcloudsdk/client.rb', line 44

def request_id
  @request_id
end

#resultsObject (readonly)

not doing accessor so user, can’t update these values from response. You will see in the code some of these items are being updated via back doors and such.



44
45
46
# File 'lib/marketingcloudsdk/client.rb', line 44

def results
  @results
end

Instance Method Details

#continueObject

Raises:

  • (NotImplementedError)


68
69
70
# File 'lib/marketingcloudsdk/client.rb', line 68

def continue
	raise NotImplementedError
end

#moreObject Also known as: more?



53
54
55
# File 'lib/marketingcloudsdk/client.rb', line 53

def more
	@more ||= false
end

#successObject Also known as: success?, status

some defaults



47
48
49
# File 'lib/marketingcloudsdk/client.rb', line 47

def success
	@success ||= false
end