Exception: Drunit::RemoteError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Drunit::RemoteError
- Defined in:
- lib/drunit/remote_error.rb
Class Attribute Summary collapse
Instance Method Summary collapse
- #class ⇒ Object
-
#initialize(exception_name) ⇒ RemoteError
constructor
A new instance of RemoteError.
- #look_up_exception ⇒ Object
Constructor Details
#initialize(exception_name) ⇒ RemoteError
Returns a new instance of RemoteError.
11 12 13 |
# File 'lib/drunit/remote_error.rb', line 11 def initialize(exception_name) @exception_name = exception_name.to_s end |
Class Attribute Details
.name ⇒ Object
5 6 7 |
# File 'lib/drunit/remote_error.rb', line 5 def name @name || super end |
Instance Method Details
#class ⇒ Object
15 16 17 18 19 20 |
# File 'lib/drunit/remote_error.rb', line 15 def class type = look_up_exception return type if type super.name = @exception_name #Now we hope and prey that the name of the class is checked imidiately super end |
#look_up_exception ⇒ Object
22 23 24 25 26 |
# File 'lib/drunit/remote_error.rb', line 22 def look_up_exception @exception_name.split("::").inject(Object){|node, part| node && node.const_defined?(part) && node.const_get(part) } end |