Sha256: ecb46d0eada49954f9c36e45a07df488bf72a13faf4eb172d9aadc4435783292

Contents?: true

Size: 947 Bytes

Versions: 96

Compression:

Stored size: 947 Bytes

Contents

module Rackspace
  class << self
    if Fog.credentials[:rackspace_api_key] && Fog.credentials[:rackspace_username]

      def initialized?
        true
      end

      def [](service)
        @@connections ||= Hash.new do |hash, key|
          credentials = Fog.credentials.reject do |k,v|
            ![:rackspace_api_key, :rackspace_username].include?(k)
          end
          hash[key] = case key
          when :files
            Fog::Rackspace::Files.new(credentials)
          when :servers
            Fog::Rackspace::Servers.new(credentials)
          end
        end
        @@connections[service]
      end

      def directories
        self[:files].directories
      end

      def flavors
        self[:servers].flavors
      end

      def images
        self[:servers].images
      end

      def servers
        self[:servers].servers
      end
      
    else

      def initialized?
        false
      end

    end
  end
end

Version data entries

96 entries across 96 versions & 2 rubygems

Version Path
fog-0.2.10 lib/fog/rackspace/bin.rb
fog-0.2.9 lib/fog/rackspace/bin.rb
fog-0.2.8 lib/fog/rackspace/bin.rb
fog-0.2.7 lib/fog/rackspace/bin.rb
fog-0.2.6 lib/fog/rackspace/bin.rb
fog-0.2.5 lib/fog/rackspace/bin.rb
fog-0.2.4 lib/fog/rackspace/bin.rb
fog-0.2.3 lib/fog/rackspace/bin.rb
fog-0.2.2 lib/fog/rackspace/bin.rb
fog-0.2.1 lib/fog/rackspace/bin.rb
fog-0.2.0 lib/fog/rackspace/bin.rb
fog-0.1.10 lib/fog/rackspace/bin.rb
fog-0.1.9 lib/fog/rackspace/bin.rb
fog-0.1.8 lib/fog/rackspace/bin.rb
fog-0.1.7 lib/fog/rackspace/bin.rb
fog-0.1.6 lib/fog/rackspace/bin.rb
fog-0.1.5 lib/fog/rackspace/bin.rb
fog-0.1.4 lib/fog/rackspace/bin.rb
fog-0.1.3 lib/fog/rackspace/bin.rb
fog-0.1.2 lib/fog/rackspace/bin.rb