Class: Panda::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/panda/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Error

Returns a new instance of Error.



7
8
9
10
11
# File 'lib/panda/error.rb', line 7

def initialize(options)
 @original_hash = options
 @message = options['message']
 @error_class = options['error']
end

Instance Attribute Details

#error_classObject (readonly)

Returns the value of attribute error_class.



4
5
6
# File 'lib/panda/error.rb', line 4

def error_class
  @error_class
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/panda/error.rb', line 3

def message
  @message
end

#original_hashObject (readonly)

Returns the value of attribute original_hash.



5
6
7
# File 'lib/panda/error.rb', line 5

def original_hash
  @original_hash
end

Instance Method Details

#raise!Object



13
14
15
# File 'lib/panda/error.rb', line 13

def raise!
  raise(self.to_s)
end

#to_sObject



17
18
19
# File 'lib/panda/error.rb', line 17

def to_s
  "#{@error_class}: #{@message}"
end