Sha256: 45f34c44f2e78c2f3629aff408d604f6613a57efd85600116c7f5b7ae67fcb4c

Contents?: true

Size: 530 Bytes

Versions: 23

Compression:

Stored size: 530 Bytes

Contents

module Fog
  module Compute
    class Google
      class Regions < Fog::Collection
        model Fog::Compute::Google::Region

        def all
          data = service.list_regions.to_h
          load(data[:items] || [])
        end

        def get(identity)
          if identity
            region = service.get_region(identity).to_h
            return new(region)
          end
        rescue ::Google::Apis::ClientError => e
          raise e unless e.status_code == 404
          nil
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
fog-google-1.22.0 lib/fog/compute/google/models/regions.rb
fog-google-1.21.1 lib/fog/compute/google/models/regions.rb
fog-google-1.21.0 lib/fog/compute/google/models/regions.rb
fog-google-1.20.0 lib/fog/compute/google/models/regions.rb
fog-google-1.19.0 lib/fog/compute/google/models/regions.rb
fog-google-1.18.0 lib/fog/compute/google/models/regions.rb
fog-google-1.17.0 lib/fog/compute/google/models/regions.rb
fog-google-1.16.1 lib/fog/compute/google/models/regions.rb
fog-google-1.16.0 lib/fog/compute/google/models/regions.rb
fog-google-1.15.0 lib/fog/compute/google/models/regions.rb
fog-google-1.14.0 lib/fog/compute/google/models/regions.rb
gitlab-fog-google-1.14.0 lib/fog/compute/google/models/regions.rb
fog-google-1.13.0 lib/fog/compute/google/models/regions.rb
gitlab-fog-google-1.13.0 lib/fog/compute/google/models/regions.rb
fog-google-1.12.1 lib/fog/compute/google/models/regions.rb
fog-google-1.12.0 lib/fog/compute/google/models/regions.rb
fog-google-1.11.0 lib/fog/compute/google/models/regions.rb
fog-google-1.10.0 lib/fog/compute/google/models/regions.rb
fog-google-1.9.1 lib/fog/compute/google/models/regions.rb
fog-google-1.9.0 lib/fog/compute/google/models/regions.rb