Exception: One::EmailDirect::EmailDirectException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/one/email_direct/exception.rb

Overview

Class to encapsulate EmailDirect web service errors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, message) ⇒ EmailDirectException

Constructs an EmailDirectException instance.

Parameters:

  • code (Fixnum)

    the webservice error status.

  • message (String)

    the webservice error message.



14
15
16
17
# File 'lib/one/email_direct/exception.rb', line 14

def initialize(code, message)
  @code = code
  @message = message
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'lib/one/email_direct/exception.rb', line 5

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/one/email_direct/exception.rb', line 5

def message
  @message
end

Instance Method Details

#to_sString

Returns a string representation of this object.

Returns:

  • (String)

    string representation of this object.



24
25
26
# File 'lib/one/email_direct/exception.rb', line 24

def to_s()
  '[%s] %s' % [@code, @message]
end