Sha256: 33469d0c4d9d714b296a6110d8bfdbe36ae13e77d4b383fdadeb1c5ca67f869a

Contents?: true

Size: 534 Bytes

Versions: 6

Compression:

Stored size: 534 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
          clear
          data = connection.list_domains.body.map {|zone| zone['domain']}
          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

6 entries across 6 versions & 1 rubygems

Version Path
fog-0.8.2 lib/fog/dns/models/dnsimple/zones.rb
fog-0.8.1 lib/fog/dns/models/dnsimple/zones.rb
fog-0.8.0 lib/fog/dns/models/dnsimple/zones.rb
fog-0.7.2 lib/fog/dns/models/dnsimple/zones.rb
fog-0.7.1 lib/fog/dns/models/dnsimple/zones.rb
fog-0.7.0 lib/fog/dns/models/dnsimple/zones.rb