Exception: SmartEnum::DuplicateIDError

Inherits:
RegistrationError show all
Defined in:
lib/smart_enum.rb

Instance Attribute Summary collapse

Attributes inherited from RegistrationError

#attributes, #type

Instance Method Summary collapse

Constructor Details

#initialize(type:, id:, attributes:, existing:) ⇒ DuplicateIDError

Returns a new instance of DuplicateIDError.



196
197
198
199
200
# File 'lib/smart_enum.rb', line 196

def initialize(type:,id:,attributes:,existing:)
  @id = id
  @existing = existing
  super("The ID #{@id} has already been registered with #{existing}", type: type, attributes: attributes)
end

Instance Attribute Details

#existingObject (readonly)

Returns the value of attribute existing.



194
195
196
# File 'lib/smart_enum.rb', line 194

def existing
  @existing
end

#idObject (readonly)

Returns the value of attribute id.



194
195
196
# File 'lib/smart_enum.rb', line 194

def id
  @id
end