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.



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

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

Instance Method Details

#destroyObject



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

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

#saveObject



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

def save
  identity ? update : create
end