Class: Record

Inherits:
Resource
  • Object
show all
Defined in:
lib/slicehost-tools/resources/dns.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.to_zone_rr(options = {}) ⇒ Object



22
23
24
25
# File 'lib/slicehost-tools/resources/dns.rb', line 22

def self.to_zone_rr(options = {})
  id = "; ID=#{options[:id]}" if options[:id]
  "%-20s %-10s IN %-10s %-25s %s" % [options[:name], options[:ttl], options[:type], options[:data], id]
end

Instance Method Details

#to_zone_rrObject



16
17
18
19
20
# File 'lib/slicehost-tools/resources/dns.rb', line 16

def to_zone_rr                 
  options = { :name => name, :ttl => ttl, :type => type, :data => data }
  options[:id] = id unless new_record?
  self.class.to_zone_rr(options)
end