Class: Multitenancy::Tenant
- Inherits:
-
Object
- Object
- Multitenancy::Tenant
- Defined in:
- lib/multitenancy/tenant.rb
Instance Attribute Summary collapse
-
#sub_tenant_id ⇒ Object
readonly
Returns the value of attribute sub_tenant_id.
-
#tenant_id ⇒ Object
readonly
Returns the value of attribute tenant_id.
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(tenant_id, sub_tenant_id = nil) ⇒ Tenant
constructor
A new instance of Tenant.
Constructor Details
#initialize(tenant_id, sub_tenant_id = nil) ⇒ Tenant
Returns a new instance of Tenant.
6 7 8 9 |
# File 'lib/multitenancy/tenant.rb', line 6 def initialize(tenant_id, sub_tenant_id=nil) @tenant_id = tenant_id @sub_tenant_id = sub_tenant_id end |
Instance Attribute Details
#sub_tenant_id ⇒ Object (readonly)
Returns the value of attribute sub_tenant_id.
4 5 6 |
# File 'lib/multitenancy/tenant.rb', line 4 def sub_tenant_id @sub_tenant_id end |
#tenant_id ⇒ Object (readonly)
Returns the value of attribute tenant_id.
4 5 6 |
# File 'lib/multitenancy/tenant.rb', line 4 def tenant_id @tenant_id end |
Instance Method Details
#headers ⇒ Object
11 12 13 |
# File 'lib/multitenancy/tenant.rb', line 11 def headers {Multitenancy.tenant_header => tenant_id, Multitenancy.sub_tenant_header => sub_tenant_id} end |