Class: Zone

Inherits:
ActiveResource::Base
  • Object
show all
Defined in:
lib/zone.rb,
lib/slicehost-dns.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create_for_domain(domain) ⇒ Object



7
8
9
10
11
12
# File 'lib/zone.rb', line 7

def self.create_for_domain(domain)
  $LOG.info "> domain record doesn't exist yet, creating" if $LOG
  zone = self.new(:origin => "#{domain}.")
  zone.save
  zone
end

Instance Method Details

#destroyObject



56
57
58
# File 'lib/slicehost-dns.rb', line 56

def destroy
  $LOG.info("~> dry destroying zone #{origin}")
end

#domainObject



3
4
5
# File 'lib/zone.rb', line 3

def domain
  origin.sub(/\.$/,'')
end

#new_record(attrs = {}) ⇒ Object



14
15
16
# File 'lib/zone.rb', line 14

def new_record(attrs={})
  Record.new(attrs.merge({:zone_id => id}))
end

#saveObject



53
54
55
# File 'lib/slicehost-dns.rb', line 53

def save
  $LOG.info("~> dry saving zone #{origin}")
end