Exception: Apartment::TenantExists
- Inherits:
-
ApartmentError
- Object
- StandardError
- ApartmentError
- Apartment::TenantExists
- Defined in:
- lib/apartment/errors.rb
Overview
Raised when attempting to create a tenant that already exists.
Instance Attribute Summary collapse
-
#tenant ⇒ Object
readonly
Returns the value of attribute tenant.
Instance Method Summary collapse
-
#initialize(tenant = nil) ⇒ TenantExists
constructor
A new instance of TenantExists.
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
#tenant ⇒ Object (readonly)
Returns the value of attribute tenant.
19 20 21 |
# File 'lib/apartment/errors.rb', line 19 def tenant @tenant end |