Class: OpenStack::Glance::Base

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

Direct Known Subclasses

Image

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



23
24
25
26
27
28
29
# File 'lib/open_stack/glance/base.rb', line 23

def self.site
  if self == OpenStack::Glance::Base
    Thread.current[:open_stack_glance_site]
  else
    super
  end
end

.site=(site) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/open_stack/glance/base.rb', line 31

def self.site=(site)
  super(site)
  Thread.current[:open_stack_glance_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