Parent

Class/Module Index [+]

Quicksearch

Fog::DNS::DNSimple::Record

Public Class Methods

new(attributes={}) click to toggle source
# File lib/fog/dnsimple/models/dns/record.rb, line 23
def initialize(attributes={})
  self.ttl ||= 3600
  super
end

Public Instance Methods

destroy() click to toggle source
# File lib/fog/dnsimple/models/dns/record.rb, line 28
def destroy
  service.delete_record(zone.domain, identity)
  true
end
save() click to toggle source
# File lib/fog/dnsimple/models/dns/record.rb, line 37
def save
  requires :name, :type, :value
  options = {}
  options[:prio] = priority if priority
  options[:ttl]  = ttl if ttl

  # decide whether its a new record or update of an existing
  if id.nil?
    data = service.create_record(zone.domain, name, type, value, options)
  else
    options[:name] = name if name
    options[:content] = value if value
    options[:type] = type if type
    data = service.update_record(zone.domain, id, options)
  end

  merge_attributes(data.body["record"])
  true
end
zone() click to toggle source
# File lib/fog/dnsimple/models/dns/record.rb, line 33
def zone
  @zone
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.