Sha256: 150689f88ab4df6c2f1932870cf4274ecd96178adb8bdead52f4034f2c3ac534

Contents?: true

Size: 538 Bytes

Versions: 1

Compression:

Stored size: 538 Bytes

Contents

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

module Fog
  module Compute
    class Bluebox

      class Flavors < Fog::Collection

        model Fog::Compute::Bluebox::Flavor

        def all
          data = connection.get_products.body
          load(data)
        end

        def get(product_id)
          response = connection.get_product(product_id)
          new(response.body)
        rescue Fog::Compute::Bluebox::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rackspace-fog-1.4.2 lib/rackspace-fog/bluebox/models/compute/flavors.rb