Class: Fog::DNS::Rage4::Zone

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/rage4/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



14
15
16
17
# File 'lib/fog/rage4/models/dns/zone.rb', line 14

def destroy
  service.delete_domain(id)
  true
end

#nameserversObject



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

def nameservers
  [
   "ns1.r4ns.com",
   "ns2.r4ns.com",
  ]
end

#recordsObject



19
20
21
22
23
24
25
26
# File 'lib/fog/rage4/models/dns/zone.rb', line 19

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

#saveObject



35
36
37
38
39
40
# File 'lib/fog/rage4/models/dns/zone.rb', line 35

def save
  requires :domain
  data = service.create_domain(domain).body["id"]
  merge_attributes(data)
  true
end