Class: Multitenancy::Tenant

Inherits:
Object
  • Object
show all
Defined in:
lib/multitenancy/tenant.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (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_idObject (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

#headersObject



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