Sha256: 6c78f234920b5617753406f61f286f77033218add9bc3c9be711cc403437f41e

Contents?: true

Size: 900 Bytes

Versions: 7

Compression:

Stored size: 900 Bytes

Contents

require 'fog/core/model'
require 'fog/dns/models/dnsmadeeasy/records'

module Fog
  module DNS
    class DNSMadeEasy

      class Zone < Fog::Model

        identity  :id
        attribute :domain,      :aliases => 'name'
        attribute :gtd_enabled, :aliases => 'gtdEnabled'
        attribute :nameservers, :aliases => 'nameServer'

        def destroy
          requires :identity
          connection.delete_domain(identity)
          true
        end

        def records
          @records ||= begin
            Fog::DNS::DNSMadeEasy::Records.new(
              :zone       => self,
              :connection => connection
            )
          end
        end

        def save
          requires :domain
          data = connection.create_domain(domain).body
          self.identity = data['name']
          merge_attributes(data)
          true
        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/zone.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/dns/models/dnsmadeeasy/zone.rb
fog-0.11.0 lib/fog/dns/models/dnsmadeeasy/zone.rb
fog-0.10.0 lib/fog/dns/models/dnsmadeeasy/zone.rb
fog4encbs-0.9.0.1 lib/fog/dns/models/dnsmadeeasy/zone.rb
fog4encbs-0.9.0 lib/fog/dns/models/dnsmadeeasy/zone.rb
fog-0.9.0 lib/fog/dns/models/dnsmadeeasy/zone.rb