Sha256: 0a7a303871bf05e7a1a5a6a9544b96d6176ae6c4794f46c029c70b9d86bf069e

Contents?: true

Size: 791 Bytes

Versions: 4

Compression:

Stored size: 791 Bytes

Contents

class Brightbox < Fog::Bin
  class << self

    def class_for(key)
      case key
      when :compute
        Fog::Compute::Brightbox
      else 
        raise ArgumentError, "Unrecognized service: #{key}"
      end
    end

    def [](service)
      @@connections ||= Hash.new do |hash, key|
        hash[key] = case key
        when :compute
          Formatador.display_line("[yellow][WARN] Brightbox[:compute] is deprecated, use Compute[:brightbox] instead[/]")
          Fog::Compute.new(:provider => 'Brightbox')
        else
          raise ArgumentError, "Unrecognized service: #{key.inspect}"
        end
      end
      @@connections[service]
    end

    def account
      @@connections[:compute].account
    end

    def services
      Fog::Brightbox.services
    end

  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/bin/brightbox.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/bin/brightbox.rb
fog-0.11.0 lib/fog/bin/brightbox.rb
fog-0.10.0 lib/fog/bin/brightbox.rb