Exception: ConfigModule::ConfigError
- Inherits:
-
NoMethodError
- Object
- NoMethodError
- ConfigModule::ConfigError
- Defined in:
- lib/config_module/exceptions.rb
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
- #custom_message ⇒ Object (also: #message)
-
#initialize(name, object, details = nil) ⇒ ConfigError
constructor
A new instance of ConfigError.
- #object_info ⇒ Object
Constructor Details
#initialize(name, object, details = nil) ⇒ ConfigError
3 4 5 6 |
# File 'lib/config_module/exceptions.rb', line 3 def initialize name, object, details = nil @name, @object, @details = name, object, details = "invalid #{identifier} `#{name}' for #{object_info}" end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
7 8 9 |
# File 'lib/config_module/exceptions.rb', line 7 def details @details end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/config_module/exceptions.rb', line 7 def name @name end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
7 8 9 |
# File 'lib/config_module/exceptions.rb', line 7 def object @object end |
Instance Method Details
#custom_message ⇒ Object Also known as: message
9 10 11 |
# File 'lib/config_module/exceptions.rb', line 9 def + "\n#{super_message}" end |
#object_info ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/config_module/exceptions.rb', line 16 def object_info if object.is_a?(Class) then object.name else "instance of `#{object.class} < #{object.class.superclass}'" end end |