Sha256: 552d7439f12ea3c48a5f4303ee9cedc7611a18efc6a7f79953474cd79a2993d4

Contents?: true

Size: 551 Bytes

Versions: 16

Compression:

Stored size: 551 Bytes

Contents

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

module Fog
  module Rackspace
    class Compute

      class Flavors < Fog::Collection

        model Fog::Rackspace::Compute::Flavor

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

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

      end

    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
fog-0.8.2 lib/fog/compute/models/rackspace/flavors.rb
fog-0.8.1 lib/fog/compute/models/rackspace/flavors.rb
fog-0.8.0 lib/fog/compute/models/rackspace/flavors.rb
fog-0.7.2 lib/fog/compute/models/rackspace/flavors.rb
fog-0.7.1 lib/fog/compute/models/rackspace/flavors.rb
fog-0.7.0 lib/fog/compute/models/rackspace/flavors.rb
fog-0.6.0 lib/fog/compute/models/rackspace/flavors.rb
fog-0.5.3 lib/fog/compute/models/rackspace/flavors.rb
fog-0.5.2 lib/fog/compute/models/rackspace/flavors.rb
fog-0.5.1 lib/fog/compute/models/rackspace/flavors.rb
fog-0.5.0 lib/fog/compute/models/rackspace/flavors.rb
phpfog-fog-0.4.1.3 lib/fog/compute/models/rackspace/flavors.rb
phpfog-fog-0.4.1.2 lib/fog/compute/models/rackspace/flavors.rb
phpfog-fog-0.4.1.1 lib/fog/compute/models/rackspace/flavors.rb
phpfog-fog-0.4.1 lib/fog/compute/models/rackspace/flavors.rb
fog-0.4.1 lib/fog/compute/models/rackspace/flavors.rb