class TortoiseLabs::DNS::Record

DNS record class

Attributes

content[R]
id[R]
name[R]
prio[R]
ttl[R]
type[R]
zoneid[RW]

Public Class Methods

new(rhash) click to toggle source
# File lib/tortoiselabs/dns.rb, line 71
def initialize(rhash)
  @id, @name, @content = rhash["id"], rhash["name"], rhash["content"]
  @prio, @ttl, @type = rhash["prio"], rhash["ttl"], rhash["type"]
end

Public Instance Methods

delete() click to toggle source
# File lib/tortoiselabs/dns.rb, line 82
def delete
  resp = TortoiseLabs::Client.get("/dns/zone/#{@zoneid}/record/#{@id}/delete")
  Zone.new(JSON.parse(resp)["zone"])
end
modify(new_content, subdomain = @name) click to toggle source
# File lib/tortoiselabs/dns.rb, line 76
def modify(new_content, subdomain = @name)
  TortoiseLabs::Client.post("/dns/zone/#{@zoneid}/record/#{@id}",
      {:content => new_content, :subdomain => subdomain})
  Zone.list.values.select { |z| z.id == zoneid }[0]
end
to_s() click to toggle source
# File lib/tortoiselabs/dns.rb, line 87
def to_s
  "#{@type}:#{@name}"
end