Sha256: 1362b118dbb440ae153221bbd6dc649878d175abe5f4f1678bfd8edd3427fa16

Contents?: true

Size: 589 Bytes

Versions: 7

Compression:

Stored size: 589 Bytes

Contents

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

module Fog
  module DNS
    class DNSMadeEasy

      class Zones < Fog::Collection

        model Fog::DNS::DNSMadeEasy::Zone

        def all
          clear
          data = connection.list_domains.body['list'].collect{|domain| {:id => domain}}
          load(data)
        end

        def get(zone_id)
          data = connection.get_domain(zone_id).body
          data.merge!(:id => data['name'])
          new(data)
        rescue Fog::Service::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/dns/models/dnsmadeeasy/zones.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/dns/models/dnsmadeeasy/zones.rb
fog-0.11.0 lib/fog/dns/models/dnsmadeeasy/zones.rb
fog-0.10.0 lib/fog/dns/models/dnsmadeeasy/zones.rb
fog4encbs-0.9.0.1 lib/fog/dns/models/dnsmadeeasy/zones.rb
fog4encbs-0.9.0 lib/fog/dns/models/dnsmadeeasy/zones.rb
fog-0.9.0 lib/fog/dns/models/dnsmadeeasy/zones.rb