Sha256: a03c8a74cef7511d51cc79d5e1d202fbede8c6fc9a456a32ce1cccc3cbb81793

Contents?: true

Size: 511 Bytes

Versions: 8

Compression:

Stored size: 511 Bytes

Contents

require 'fog/collection'
require 'fog/slicehost/models/compute/flavor'

module Fog
  module Slicehost
    class Compute

      class Flavors < Fog::Collection

        model Fog::Slicehost::Compute::Flavor

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

        def get(flavor_id)
          data = connection.get_flavor(flavor_id).body
          new(data)
        rescue Excon::Errors::Forbidden
          nil
        end

      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fog-0.3.7 lib/fog/slicehost/models/compute/flavors.rb
fog-0.3.6 lib/fog/slicehost/models/compute/flavors.rb
fog-0.3.5 lib/fog/slicehost/models/compute/flavors.rb
fog-0.3.4 lib/fog/slicehost/models/compute/flavors.rb
fog-0.3.3 lib/fog/slicehost/models/compute/flavors.rb
fog-0.3.2 lib/fog/slicehost/models/compute/flavors.rb
fog-0.3.1 lib/fog/slicehost/models/compute/flavors.rb
fog-0.3.0 lib/fog/slicehost/models/compute/flavors.rb