Exception: Tengine::Core::FindByName::Error

Inherits:
Errors::NotFound show all
Defined in:
lib/tengine/core/find_by_name.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = nil)
  @klass, @name, @options = klass, name, options
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



8
9
10
# File 'lib/tengine/core/find_by_name.rb', line 8

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/tengine/core/find_by_name.rb', line 8

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/tengine/core/find_by_name.rb', line 8

def options
  @options
end

Instance Method Details

#messageObject



12
13
14
15
16
17
# File 'lib/tengine/core/find_by_name.rb', line 12

def message
  result = "#{klass.name} named #{name.inspect}"
  result << " with #{options.inspect}" if options && !options.empty?
  result << ' not found'
  result
end