Class: Fog::DNS::Rackspace::Zone

Inherits:
Model
  • Object
show all
Includes:
Callback
Defined in:
lib/fog/rackspace/models/dns/zone.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#destroyObject



22
23
24
25
26
# File 'lib/fog/rackspace/models/dns/zone.rb', line 22

def destroy
  response = service.remove_domain(identity)
  wait_for_job response.body['jobId'], Fog.timeout
  true
end

#recordsObject



28
29
30
31
32
33
34
35
# File 'lib/fog/rackspace/models/dns/zone.rb', line 28

def records
  @records ||= begin
    Fog::DNS::Rackspace::Records.new(
      :zone       => self,
      :service => service
    )
  end
end

#saveObject



37
38
39
40
41
42
43
44
# File 'lib/fog/rackspace/models/dns/zone.rb', line 37

def save
  if persisted?
    update
  else
    create
  end
  true
end