class Fog::DNS::Zerigo::Records

Public Instance Methods

all() click to toggle source
# File lib/fog/zerigo/models/dns/records.rb, line 14
def all
  requires :zone
  parent = zone.collection.get(zone.identity)
  if parent
    merge_attributes(parent.records.attributes)
    load(parent.records.map {|record| record.attributes})
  else
    nil
  end
end
find(fqdn) click to toggle source
# File lib/fog/zerigo/models/dns/records.rb, line 37
def find(fqdn)
  hosts = connection.find_hosts(fqdn, zone.id).body['hosts']
  hosts.collect { |host| new(host) }
end
get(record_id) click to toggle source
# File lib/fog/zerigo/models/dns/records.rb, line 25
def get(record_id)
  data = connection.get_host(record_id).body
  new(data)
rescue Fog::Service::NotFound
  nil
end
new(attributes = {}) click to toggle source
# File lib/fog/zerigo/models/dns/records.rb, line 32
def new(attributes = {})
  requires :zone
  super({ :zone => zone }.merge!(attributes))
end