Class: Fog::DNS::Linode::Records

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/linode/models/dns/records.rb

Instance Method Summary collapse

Instance Method Details

#allObject



12
13
14
15
16
# File 'lib/fog/linode/models/dns/records.rb', line 12

def all
  requires :zone
  data = service.domain_resource_list(zone.id).body['DATA']
  load(data)
end

#get(record_id) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/fog/linode/models/dns/records.rb', line 18

def get(record_id)
  if data = service.domain_resource_list(zone.id, record_id).body['DATA'].first
    new(data)
  else
    nil
  end
end

#new(attributes = {}) ⇒ Object



26
27
28
29
# File 'lib/fog/linode/models/dns/records.rb', line 26

def new(attributes = {})
  requires :zone
  super({ :zone => zone }.merge!(attributes))
end