Exception: Pdf4me::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Pdf4me::Error
- Defined in:
- lib/pdf4me/exceptions.rb
Direct Known Subclasses
InvalidAttributes, InvalidStatusCode, ServerError, ServerTimedOut
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
-
#initialize(arg = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(arg = nil) ⇒ Error
Returns a new instance of Error.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pdf4me/exceptions.rb', line 5 def initialize(arg = nil) if arg.is_a? Hash if arg.key?(:message) || arg.key?('message') super(arg[:message] || arg['message']) else super arg end arg.each do |k, v| instance_variable_set "@#{k}", v end else super arg end end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/pdf4me/exceptions.rb', line 3 def code @code end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
3 4 5 |
# File 'lib/pdf4me/exceptions.rb', line 3 def error @error end |