Sha256: 6760c2b883be28bfbb7aedad8d66cb80d41a983b822fb8dc9c84752d4b1f5842

Contents?: true

Size: 586 Bytes

Versions: 10

Compression:

Stored size: 586 Bytes

Contents

module Fog
  module Metering
    def self.[](provider)
      new(:provider => provider)
    end

    def self.new(attributes)
      attributes = attributes.dup # Prevent delete from having side effects
      provider = attributes.delete(:provider).to_s.downcase.to_sym
      if providers.include?(provider)
        require "fog/#{provider}/metering"
        return Fog::Metering.const_get(Fog.providers[provider]).new(attributes)
      end

      raise ArgumentError, "#{provider} has no identity service"
    end

    def self.providers
      Fog.services[:metering]
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-core-1.30.0/lib/fog/metering.rb
fog-core-1.30.0 lib/fog/metering.rb
fog-core-1.29.0 lib/fog/metering.rb
fog-core-1.28.0 lib/fog/metering.rb
fog-core-1.27.4 lib/fog/metering.rb
fog-core-1.27.3 lib/fog/metering.rb
fog-core-1.27.2 lib/fog/metering.rb
fog-core-1.27.1 lib/fog/metering.rb
fog-core-1.27.0 lib/fog/metering.rb
fog-core-1.25.0 lib/fog/metering.rb