Exception: PostDB::MailLocationError
- Inherits:
-
StandardError
- Object
- StandardError
- PostDB::MailLocationError
- Defined in:
- lib/postdb/errors/mail_location.rb
Overview
The MailLocationError error is used by the MailLocation class
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
An array containing additional arguments.
-
#attribute ⇒ Object
readonly
A suberror to describe the error in more detail.
Instance Method Summary collapse
-
#initialize(suberror = nil, *args) ⇒ MailLocationError
constructor
Example: >> raise PostDB::MailLocationError.new => #<PostDB::MailLocationError:0x00000000000000>.
-
#to_s ⇒ Object
Convert the error to a string.
Constructor Details
#initialize(suberror = nil, *args) ⇒ MailLocationError
Example:
>> raise PostDB::MailLocationError.new
=> #<PostDB::MailLocationError:0x00000000000000>
23 24 25 26 27 28 29 |
# File 'lib/postdb/errors/mail_location.rb', line 23 def initialize(suberror = nil, *args) # Store the suberror property (if provided) @suberror = suberror if suberror # Store the arguments @arguments = args end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
An array containing additional arguments
11 12 13 |
# File 'lib/postdb/errors/mail_location.rb', line 11 def arguments @arguments end |
#attribute ⇒ Object (readonly)
A suberror to describe the error in more detail
7 8 9 |
# File 'lib/postdb/errors/mail_location.rb', line 7 def attribute @attribute end |
Instance Method Details
#to_s ⇒ Object
Convert the error to a string
Example:
>> error.to_s
=> "Error Description"
37 38 39 40 41 42 43 44 |
# File 'lib/postdb/errors/mail_location.rb', line 37 def to_s case @suberror when :malformed_location "'#{@arguments[0]}' is not a valid location." else super.to_s end end |