Exception: Warp::Dir::Errors::InstanceError
- Defined in:
- lib/warp/dir/errors.rb
Overview
This is a generic Exception that wraps an object passed to the initializer and assumed to be the reason for the failure. Message is optional, but each concrete exception should provide it’s own concrete message
Direct Known Subclasses
Instance Attribute Summary collapse
-
#instance ⇒ Object
Returns the value of attribute instance.
Instance Method Summary collapse
- #color_error(instance_type, instance, result) ⇒ Object
-
#initialize(message = nil) ⇒ InstanceError
constructor
A new instance of InstanceError.
- #name ⇒ Object
Constructor Details
#initialize(message = nil) ⇒ InstanceError
Returns a new instance of InstanceError.
24 25 26 |
# File 'lib/warp/dir/errors.rb', line 24 def initialize( = nil) super ? : "#{self.class.name}->[#{instance}]" end |
Instance Attribute Details
#instance ⇒ Object
Returns the value of attribute instance.
23 24 25 |
# File 'lib/warp/dir/errors.rb', line 23 def instance @instance end |
Instance Method Details
#color_error(instance_type, instance, result) ⇒ Object
32 33 34 35 36 |
# File 'lib/warp/dir/errors.rb', line 32 def color_error instance_type, instance, result instance_type.red.bold + instance.to_s.yellow.bold + result.red.bold end |
#name ⇒ Object
28 29 30 |
# File 'lib/warp/dir/errors.rb', line 28 def name super.gsub(%r{#{self.class.name}}, '') end |