Class: Fog::DNS::DNSMadeEasy::Records

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

Instance Method Summary collapse

Instance Method Details

#allObject



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

def all
  requires :zone
  data = service.list_records(zone.identity).body
  load(data)
end

#get(record_id) ⇒ Object



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

def get(record_id)
  data = service.get_record(zone.identity, record_id).body
  new(data)
rescue Fog::Service::NotFound
  nil
end

#new(attributes = {}) ⇒ Object



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

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