Class: Fog::HP::DNS::Records

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#domainObject

Returns the value of attribute domain.



10
11
12
# File 'lib/fog/hp/models/dns/records.rb', line 10

def domain
  @domain
end

Instance Method Details

#allObject



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

def all
  requires :domain
  load(service.list_records_in_a_domain(domain.id).body['records'])
end

#get(record_id) ⇒ Object



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

def get(record_id)
  requires :domain
  ### Inconsistent API - does not return a 'record'
  if record = service.get_record(domain.id, record_id).body
    new(record)
  end
rescue Fog::HP::DNS::NotFound
  nil
end