Sha256: 748a74151870afbb68b8e19e58def0e94a6001aa19b76913231f3b52f90235be

Contents?: true

Size: 1.42 KB

Versions: 18

Compression:

Stored size: 1.42 KB

Contents

# This file is part of the OpenStack-ActiveResource
#
# Copyright (C) 2012 Unidata S.p.A. (Davide Guerri - d.guerri@unidata.it)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

module OpenStack
  module Keystone
    module Admin

      class Base < OpenStack::Common

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

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

      end

    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
openstack_activeresource-0.7.1 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.7.0 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.6.3 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.6.2 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.6.1 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.6.0 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.5.2 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.5.1 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.5.0 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.4.0 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.3.5 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.3.4 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.3.3 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.3.2 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.3.1 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.3.0 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.2.1 lib/open_stack/keystone/admin/base.rb
openstack_activeresource-0.2.0 lib/open_stack/keystone/admin/base.rb