Exception: Tengine::Core::FindByName::Error
- Inherits:
-
Errors::NotFound
- Object
- StandardError
- Errors::NotFound
- Tengine::Core::FindByName::Error
- Defined in:
- lib/tengine/core/find_by_name.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(klass, name, options = nil) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
Constructor Details
#initialize(klass, name, options = nil) ⇒ Error
Returns a new instance of Error.
9 10 11 |
# File 'lib/tengine/core/find_by_name.rb', line 9 def initialize(klass, name, = nil) @klass, @name, @options = klass, name, end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
8 9 10 |
# File 'lib/tengine/core/find_by_name.rb', line 8 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/tengine/core/find_by_name.rb', line 8 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/tengine/core/find_by_name.rb', line 8 def @options end |
Instance Method Details
#message ⇒ Object
12 13 14 15 16 17 |
# File 'lib/tengine/core/find_by_name.rb', line 12 def result = "#{klass.name} named #{name.inspect}" result << " with #{.inspect}" if && !.empty? result << ' not found' result end |