Sha256: 4c18a3fdcd7078df05075e1333116c7e88a90abf1a3c9a6c9cdb8f3818a9db04

Contents?: true

Size: 683 Bytes

Versions: 33

Compression:

Stored size: 683 Bytes

Contents

require 'fog/collection'
require 'fog/rackspace/models/servers/flavor'

module Fog
  module Rackspace
    module Servers

      module Collections
        def flavors
          Fog::Rackspace::Servers::Flavors.new(:connection => self)
        end
      end

      class Flavors < Fog::Collection

        model Fog::Rackspace::Servers::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::Servers::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
fog-0.2.30 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.28 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.27 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.26 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.25 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.24 lib/fog/rackspace/models/servers/flavors.rb
tecnh-fog-0.2.23.vpc lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.23 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.22 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.21 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.20 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.19 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.18 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.17 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.16 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.15 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.14 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.13 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.12 lib/fog/rackspace/models/servers/flavors.rb
fog-0.2.11 lib/fog/rackspace/models/servers/flavors.rb