Class: Blueprinter::BlueprintValidator Private

Inherits:
Object
  • Object
show all
Defined in:
lib/blueprinter/blueprint_validator.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.validate!(blueprint) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Determines whether the provided object is a valid Blueprint.

Parameters:

  • blueprint (Object)

    The object to validate.

Returns:

  • (Boolean)

    true if object is a valid Blueprint

Raises:



12
13
14
15
16
17
18
19
20
21
# File 'lib/blueprinter/blueprint_validator.rb', line 12

def validate!(blueprint)
  if valid_blueprint?(blueprint)
    true
  else
    raise(
      Errors::InvalidBlueprint,
      "#{blueprint} is not a valid blueprint. Please ensure it subclasses Blueprinter::Base or is a Proc."
    )
  end
end