Class: NeverBounce::API::Response::Message

Inherits:
Container show all
Defined in:
lib/never_bounce/api/response/message.rb

Overview

A response message from the server. A top-level container with a few extra features.

Direct Known Subclasses

JobsDownload, StatusMessage

Instance Attribute Summary

Attributes inherited from Container

#body_hash, #raw

Instance Method Summary collapse

Methods inherited from Container

oattr, scalar_oattr

Instance Method Details

#error?Boolean

true if this an error message.

Returns:

  • (Boolean)

See Also:



10
11
12
# File 'lib/never_bounce/api/response/message.rb', line 10

def error?
  !success?
end

#ok?Boolean

An alias to #success?.

Returns:

  • (Boolean)


15
16
17
# File 'lib/never_bounce/api/response/message.rb', line 15

def ok?
  success?
end

#success?Boolean

This method is abstract.

true if this is a success message.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/never_bounce/api/response/message.rb', line 21

def success?
  raise NotImplementedError, "Redefine `success?` in your class: #{self.class}"
end