Class: Fog::HP::DNS::Record

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

Instance Method Summary collapse

Constructor Details

#initialize(new_attributes = {}) ⇒ Record

Returns a new instance of Record.



19
20
21
22
23
# File 'lib/fog/hp/models/dns/record.rb', line 19

def initialize(new_attributes = {})
  super(new_attributes)
  self.domain_id = domain.id if domain
  self
end

Instance Method Details

#destroyObject



25
26
27
28
29
# File 'lib/fog/hp/models/dns/record.rb', line 25

def destroy
  requires :id, :domain_id
  service.delete_record(self.domain_id, id)
  true
end

#saveObject



31
32
33
# File 'lib/fog/hp/models/dns/record.rb', line 31

def save
  identity ? update : create
end