Sha256: 979107bbcba18f63062253e0d6b9b04c4c573b9597096d1a62944cff2c77f1d1

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

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

module Fog
  module DNSimple
    class DNS

      class Zone < Fog::Model

        identity :id

        attribute :domain,     :aliases => 'name'
        attribute :created_at
        attribute :updated_at

        def destroy
          connection.delete_domain(identity)
          true
        end

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

        def nameservers
          [
           "ns1.dnsimple.com",
           "ns2.dnsimple.com",
           "ns3.dnsimple.com",
           "ns4.dnsimple.com",
          ]
        end

        def save
          requires :domain
          data = connection.create_domain(domain).body["domain"]
          merge_attributes(data)
          true
        end

      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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