Module: Yao::Resources::TenantAssociationable

Included in:
FloatingIP, Meter, Network, OldSample, Port, Resource, Router, SecurityGroup, Server, Subnet
Defined in:
lib/yao/resources/tenant_associationable.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
# File 'lib/yao/resources/tenant_associationable.rb', line 5

def self.included(base)
  base.friendly_attributes :project_id
  base.friendly_attributes :tenant_id
end

Instance Method Details

#tenantObject Also known as: project



10
11
12
# File 'lib/yao/resources/tenant_associationable.rb', line 10

def tenant
  @tenant ||= Yao::Tenant.find(project_id || tenant_id)
end