Exception: Machinist::NoBlueprintError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/machinist/exceptions.rb

Overview

Raised when calling make on a class with no corresponding blueprint defined.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, name) ⇒ NoBlueprintError

Returns a new instance of NoBlueprintError.



22
23
24
25
# File 'lib/machinist/exceptions.rb', line 22

def initialize(klass, name)
  @klass = klass
  @name  = name
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



20
21
22
# File 'lib/machinist/exceptions.rb', line 20

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



20
21
22
# File 'lib/machinist/exceptions.rb', line 20

def name
  @name
end

Instance Method Details

#messageObject



27
28
29
# File 'lib/machinist/exceptions.rb', line 27

def message
  "No #{@name} blueprint defined for class #{@klass.name}"
end