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.
26 27 28 |
# File 'lib/warp/dir/errors.rb', line 26 def initialize( = nil) super ? : "#{self.class.name}->[#{instance}]" end |
Instance Attribute Details
#instance ⇒ Object
Returns the value of attribute instance.
24 25 26 |
# File 'lib/warp/dir/errors.rb', line 24 def instance @instance end |
Instance Method Details
#color_error(instance_type, instance, result) ⇒ Object
34 35 36 37 38 |
# File 'lib/warp/dir/errors.rb', line 34 def color_error instance_type, instance, result instance_type.red.bold + instance.to_s.yellow.bold + result.red.bold end |
#name ⇒ Object
30 31 32 |
# File 'lib/warp/dir/errors.rb', line 30 def name super.gsub(%r{#{self.class.name}}, '') end |