Exception: ConfigModule::ConfigError
- Inherits:
-
NoMethodError
- Object
- NoMethodError
- ConfigModule::ConfigError
- Defined in:
- lib/config_module/exceptions.rb
Overview
for when a config setting error occurs
Direct Known Subclasses
ConfigModule::ConfigOption::NotFoundError, InvalidNamespaceError
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
-
#initialize(name, object, details = nil) ⇒ ConfigError
constructor
A new instance of ConfigError.
- #message ⇒ Object
- #object_info ⇒ Object
Constructor Details
#initialize(name, object, details = nil) ⇒ ConfigError
Returns a new instance of ConfigError.
6 7 8 |
# File 'lib/config_module/exceptions.rb', line 6 def initialize name, object, details = nil @name, @object, @details = name, object, details end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
9 10 11 |
# File 'lib/config_module/exceptions.rb', line 9 def details @details end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/config_module/exceptions.rb', line 9 def name @name end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
9 10 11 |
# File 'lib/config_module/exceptions.rb', line 9 def object @object end |
Instance Method Details
#message ⇒ Object
11 12 13 |
# File 'lib/config_module/exceptions.rb', line 11 def "invalid #{identifier} `#{name}' for #{object_info}" end |
#object_info ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/config_module/exceptions.rb', line 15 def object_info if object.is_a?(Class) object.name else "instance of `#{object.class} < #{object.class.superclass}'" end end |