Sha256: 08419c13ee06023594e641ddbf9060a5fa7f7a21b0a897ffd04ea43995718466

Contents?: true

Size: 516 Bytes

Versions: 4

Compression:

Stored size: 516 Bytes

Contents

require File.expand_path('../flavor', __FILE__)

module Fog
  module Compute
    class ProfitBricks
      class Flavors < Fog::Collection
        model Fog::Compute::ProfitBricks::Flavor

        def all()
          load(service.get_all_flavors.body["getAllFlavorsResponse"])
        end

        def get(id)
          flavor = service.get_flavor(id).body["getFlavorResponse"]
          Excon::Errors
          new(flavor)
        rescue Excon::Errors::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
fog-profitbricks-2.0.1 lib/fog/profitbricks/models/compute/flavors.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-profitbricks-0.0.5/lib/fog/compute/profit_bricks/models/flavors.rb
fog-profitbricks-0.0.5 lib/fog/compute/profit_bricks/models/flavors.rb
fog-profitbricks-0.0.4 lib/fog/compute/profit_bricks/models/flavors.rb