Exception: Pdf4me::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/pdf4me/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/pdf4me/exceptions.rb', line 3

def code
  @code
end

#errorObject (readonly)

Returns the value of attribute error.



3
4
5
# File 'lib/pdf4me/exceptions.rb', line 3

def error
  @error
end