Exception: Machinist::BlueprintCantSaveError

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

Overview

Raised when make! is called on a class whose blueprints don’t support saving.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(blueprint, message = nil) ⇒ BlueprintCantSaveError

Returns a new instance of BlueprintCantSaveError.



7
8
9
10
# File 'lib/machinist/exceptions.rb', line 7

def initialize(blueprint, message = nil)
  @blueprint = blueprint
  @message = message
end

Instance Attribute Details

#blueprintObject (readonly)

Returns the value of attribute blueprint.



5
6
7
# File 'lib/machinist/exceptions.rb', line 5

def blueprint
  @blueprint
end

Instance Method Details

#messageObject



12
13
14
# File 'lib/machinist/exceptions.rb', line 12

def message
  @message ||= "make! is not supported by blueprints for class #{@blueprint.klass.name}"
end