Exception: EnumerizeSchema::MissingValuesError

Inherits:
KeyError
  • Object
show all
Defined in:
lib/enumerize_schema/errors.rb

Errors collapse

Errors collapse

Constructor Details

#initialize(class_name:, attribute_name:) ⇒ MissingValuesError

Returns a new instance of MissingValuesError.

Parameters:

  • class_name (String)

    the name of the class where the enum is defined

  • attribute_name (String)

    the name of the enum attribute



36
37
38
39
40
41
# File 'lib/enumerize_schema/errors.rb', line 36

def initialize(class_name:, attribute_name:)
  @class_name = class_name
  @attribute_name = attribute_name

  super("Enumerized values missing for attribute: #{class_name}##{attribute_name}")
end

Instance Attribute Details

#attribute_nameString (readonly)

Returns the name of the enum attribute.

Returns:

  • (String)

    the name of the enum attribute



32
33
34
# File 'lib/enumerize_schema/errors.rb', line 32

def attribute_name
  @attribute_name
end

#class_nameString (readonly)

Returns the name of the class where the enum is defined.

Returns:

  • (String)

    the name of the class where the enum is defined



29
30
31
# File 'lib/enumerize_schema/errors.rb', line 29

def class_name
  @class_name
end