Class: OpenStack::Keystone::Public::Base

Inherits:
Common show all
Defined in:
lib/open_stack/keystone/public/base.rb

Direct Known Subclasses

Tenant

Class Method Summary collapse

Methods inherited from Common

collection_path, custom_method_collection_url, element_path

Methods inherited from Base

headers

Methods inherited from ActiveResource::Base

#load

Class Method Details

.siteObject

Get the Keystone endpoint assigned to OpenStack::Keystone::Public classes



25
26
27
28
29
30
31
# File 'lib/open_stack/keystone/public/base.rb', line 25

def self.site
  if self == OpenStack::Keystone::Public::Base
    Thread.current[:open_stack_keystone_public_site]
  else
    super
  end
end

.site=(site) ⇒ Object

Set the Keystone endpoint assigned to OpenStack::Keystone::Public classes



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/open_stack/keystone/public/base.rb', line 34

def self.site=(site)
  super(site)
  Thread.current[:open_stack_keystone_public_site] = @site
  # Regenerate the prefix method
  default = @site.path
  default << '/' unless default[-1..-1] == '/'
  # generate the actual method based on the current site path
  self.prefix = default

  @site
end