Exception: Apartment::TenantExists

Inherits:
ApartmentError show all
Defined in:
lib/apartment/errors.rb

Overview

Raised when attempting to create a tenant that already exists.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tenant = nil) ⇒ TenantExists

Returns a new instance of TenantExists.



21
22
23
24
# File 'lib/apartment/errors.rb', line 21

def initialize(tenant = nil)
  @tenant = tenant
  super(tenant ? "Tenant '#{tenant}' already exists" : 'Tenant already exists')
end

Instance Attribute Details

#tenantObject (readonly)

Returns the value of attribute tenant.



19
20
21
# File 'lib/apartment/errors.rb', line 19

def tenant
  @tenant
end