Sha256: a38bbc3ccdd3a18c3341d4ee98dd74450a1e1603d24344f34902f0c5569c1f23

Contents?: true

Size: 517 Bytes

Versions: 65

Compression:

Stored size: 517 Bytes

Contents

require 'fog/core/collection'
require 'fog/hp/models/compute/flavor'

module Fog
  module Compute
    class HP

      class Flavors < Fog::Collection

        model Fog::Compute::HP::Flavor

        def all
          data = service.list_flavors_detail.body['flavors']
          load(data)
        end

        def get(flavor_id)
          data = service.get_flavor_details(flavor_id).body['flavor']
          new(data)
        rescue Fog::Compute::HP::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

65 entries across 65 versions & 6 rubygems

Version Path
fog-1.10.0 lib/fog/hp/models/compute/flavors.rb
fog-1.9.0 lib/fog/hp/models/compute/flavors.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/hp/models/compute/flavors.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/hp/models/compute/flavors.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/hp/models/compute/flavors.rb