Sha256: 6cfe4713bfaca4e1fe4911038c2ae1f4d9aaab1502d33bc4c0c3221e0d31eaa9

Contents?: true

Size: 490 Bytes

Versions: 1

Compression:

Stored size: 490 Bytes

Contents

require 'fog/core/collection'
require 'fog/dns/models/dnsimple/zone'

module Fog
  module DNSimple
    class DNS

      class Zones < Fog::Collection

        model Fog::DNSimple::DNS::Zone

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

        def get(zone_id)
          data = connection.get_domain(zone_id).body['domain']
          new(data)
        rescue Excon::Errors::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-0.6.0 lib/fog/dns/models/dnsimple/zones.rb