Sha256: bb067e738a8e322f085b35cff01d0f2da011d91ec2eafee05cc6abfd44b07ffe

Contents?: true

Size: 513 Bytes

Versions: 8

Compression:

Stored size: 513 Bytes

Contents

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

module Fog
  module Bluebox
    class Compute

      class Flavors < Fog::Collection

        model Fog::Bluebox::Compute::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::Bluebox::Compute::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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