Class: Cuprum::Collections::Errors::MissingDefaultContract

Inherits:
Error
  • Object
show all
Defined in:
lib/cuprum/collections/errors/missing_default_contract.rb

Overview

Error returned when validating an entity without a contract.

Constant Summary collapse

TYPE =

Short string used to identify the type of error.

'cuprum.collections.errors.missing_default_contract'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entity_class:) ⇒ MissingDefaultContract

Returns a new instance of MissingDefaultContract.

Parameters:

  • entity_class (Class)

    The class of the assigned entity.



14
15
16
17
18
19
20
21
# File 'lib/cuprum/collections/errors/missing_default_contract.rb', line 14

def initialize(entity_class:)
  @entity_class = entity_class

  super(
    entity_class: entity_class,
    message:      default_message
  )
end

Instance Attribute Details

#entity_classClass (readonly)

Returns the class of the assigned entity.

Returns:

  • (Class)

    the class of the assigned entity.



24
25
26
# File 'lib/cuprum/collections/errors/missing_default_contract.rb', line 24

def entity_class
  @entity_class
end