Sha256: 6f7ece760d5280fb3c499fb508e02fba0c3c0ef276f38d52134653da4f326859

Contents?: true

Size: 452 Bytes

Versions: 64

Compression:

Stored size: 452 Bytes

Contents

require 'fog/core/collection'
require 'fog/digitalocean/models/compute/region'

module Fog
  module Compute
    class DigitalOcean

      class Regions < Fog::Collection
        model Fog::Compute::DigitalOcean::Region

        def all
          load service.list_regions.body['regions']
        end

        def get(id)
          all.find { |f| f.id == id }
        rescue Fog::Errors::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

64 entries across 64 versions & 5 rubygems

Version Path
fog-1.22.0 lib/fog/digitalocean/models/compute/regions.rb
fog-1.21.0 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/digitalocean/models/compute/regions.rb
cifrado-0.2.1 vendor/fog/lib/fog/digitalocean/models/compute/regions.rb
cifrado-0.2.0 vendor/fog/lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/digitalocean/models/compute/regions.rb
fog-1.20.0 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/digitalocean/models/compute/regions.rb
fog-1.19.0 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/digitalocean/models/compute/regions.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/digitalocean/models/compute/regions.rb