Class: Broadcast::Warning

Inherits:
Struct
  • Object
show all
Defined in:
lib/broadcast/response.rb

Overview

A single entry from the API's warnings array (docs: api-response-warnings). The API raises these on successful 2xx responses when it accepted the request but ignored part of it — an unrecognized parameter, a parameter that only applies in another mode, a value the server overrode.

param is a dot-path to the offending parameter (e.g. "subscriber.foo"). The API never includes submitted values, so a warning is safe to log.

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/broadcast/response.rb', line 13

def code
  @code
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



13
14
15
# File 'lib/broadcast/response.rb', line 13

def message
  @message
end

#paramObject

Returns the value of attribute param

Returns:

  • (Object)

    the current value of param



13
14
15
# File 'lib/broadcast/response.rb', line 13

def param
  @param
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/broadcast/response.rb', line 14

def to_s
  param ? "[#{code}] #{param}: #{message}" : "[#{code}] #{message}"
end