Exception: RiderKick::GeneratorError
- Inherits:
-
StandardError
- Object
- StandardError
- RiderKick::GeneratorError
- Defined in:
- lib/generators/rider_kick/errors.rb
Overview
Base error class for all generator errors
Direct Known Subclasses
ConfigurationError, FileNotFoundError, ModelNotFoundError, ValidationError, YamlFormatError
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(message, context = {}) ⇒ GeneratorError
constructor
A new instance of GeneratorError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, context = {}) ⇒ GeneratorError
Returns a new instance of GeneratorError.
8 9 10 11 |
# File 'lib/generators/rider_kick/errors.rb', line 8 def initialize(, context = {}) super() @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/generators/rider_kick/errors.rb', line 6 def context @context end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/generators/rider_kick/errors.rb', line 13 def to_s if @context.any? context_str = @context.map { |k, v| "#{k}: #{v}" }.join(', ') "#{super} (#{context_str})" else super end end |