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.



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

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

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



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

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#messageObject



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

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