Sha256: b7a087cc614ced99caae4c6e2223a1b0e71b8058e84672cb94ff16c1ac8c036f

Contents?: true

Size: 691 Bytes

Versions: 1

Compression:

Stored size: 691 Bytes

Contents

module Machinist
  # Raised when make! is called on a class whose blueprints don't support
  # saving.
  class BlueprintCantSaveError < RuntimeError
    attr_reader :blueprint

    def initialize(blueprint)
      @blueprint = blueprint
    end

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

  # Raised when calling make on a class with no corresponding blueprint
  # defined.
  class NoBlueprintError < RuntimeError
    attr_reader :klass, :name

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
machinist_redux-3.0.0 lib/machinist/exceptions.rb