Sha256: c8e56c3109fa7611c0ab740c8d528fe263f57392e578a0dd92faf6731debe0e3

Contents?: true

Size: 744 Bytes

Versions: 36

Compression:

Stored size: 744 Bytes

Contents

module Bluebox
  class << self

    if Fog.credentials[:bluebox_api_key]

      def initialized?
        true
      end

      def [](service)
        @@connections ||= Hash.new do |hash, key|
          credentials = Fog.credentials.reject do |k,v|
            ![:bluebox_api_key, :bluebox_customer_id].include?(k)
          end
          hash[key] = case key
          when :blocks
            Fog::Bluebox.new(credentials)
          end
        end
        @@connections[service]
      end

      def flavors
        self[:blocks].flavors
      end

      def images
        self[:blocks].images
      end

      def servers
        self[:blocks].servers
      end

    else

      def initialized?
        false
      end

    end
  end
end

Version data entries

36 entries across 36 versions & 2 rubygems

Version Path
fog-0.2.30 lib/fog/bluebox/bin.rb
fog-0.2.28 lib/fog/bluebox/bin.rb
fog-0.2.27 lib/fog/bluebox/bin.rb
fog-0.2.26 lib/fog/bluebox/bin.rb
fog-0.2.25 lib/fog/bluebox/bin.rb
fog-0.2.24 lib/fog/bluebox/bin.rb
tecnh-fog-0.2.23.vpc lib/fog/bluebox/bin.rb
fog-0.2.23 lib/fog/bluebox/bin.rb
fog-0.2.22 lib/fog/bluebox/bin.rb
fog-0.2.21 lib/fog/bluebox/bin.rb
fog-0.2.20 lib/fog/bluebox/bin.rb
fog-0.2.19 lib/fog/bluebox/bin.rb
fog-0.2.18 lib/fog/bluebox/bin.rb
fog-0.2.17 lib/fog/bluebox/bin.rb
fog-0.2.16 lib/fog/bluebox/bin.rb
fog-0.2.15 lib/fog/bluebox/bin.rb
fog-0.2.14 lib/fog/bluebox/bin.rb
fog-0.2.13 lib/fog/bluebox/bin.rb
fog-0.2.12 lib/fog/bluebox/bin.rb
fog-0.2.11 lib/fog/bluebox/bin.rb