Exception: RoyalMailApi::Error
- Inherits:
-
StandardError
- Object
- StandardError
- RoyalMailApi::Error
- Defined in:
- lib/royal_mail_api/error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#description ⇒ Object
Returns the value of attribute description.
Instance Method Summary collapse
-
#initialize(args) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(args) ⇒ Error
Returns a new instance of Error.
5 6 7 8 |
# File 'lib/royal_mail_api/error.rb', line 5 def initialize(args) raise ArgumentError 'royal mail error must be initialized with a hash' unless args.is_a? Hash raise ArgumentError 'error must contain some information' unless args.present? end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/royal_mail_api/error.rb', line 3 def code @code end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/royal_mail_api/error.rb', line 3 def description @description end |