Class: Fog::DNS::Softlayer::Records

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

Instance Method Summary collapse

Instance Method Details

#allObject



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

def all
  requires :domain
  clear
  data = service.get_records(domain.id).body
  load(data)
end

#get(identifier) ⇒ Object



25
26
27
28
29
30
31
32
# File 'lib/fog/softlayer/models/dns/records.rb', line 25

def get(identifier)
  return nil if identifier.nil? || identifier == ""
  response = service.get_record(identifier)
  data = response.body
  new.merge_attributes(data)
rescue Excon::Errors::NotFound
  nil
end

#new(attributes = {}) ⇒ Object



34
35
36
# File 'lib/fog/softlayer/models/dns/records.rb', line 34

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