Class: Fog::DNS::Dynect::Zone
- Inherits:
-
Model
- Object
- Model
- Fog::DNS::Dynect::Zone
show all
- Defined in:
- lib/fog/dynect/models/dns/zone.rb
Instance Attribute Summary
Attributes inherited from Model
#collection, #service
Instance Method Summary
collapse
Methods inherited from Model
#inspect, #reload, #symbolize_keys, #to_json, #wait_for
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
#connection, #connection=, #prepare_service_value
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
#initialize(attributes = {}) ⇒ Zone
Returns a new instance of Zone.
19
20
21
|
# File 'lib/fog/dynect/models/dns/zone.rb', line 19
def initialize(attributes={})
super
end
|
Instance Method Details
#destroy ⇒ Object
23
24
25
26
27
|
# File 'lib/fog/dynect/models/dns/zone.rb', line 23
def destroy
requires :domain
service.delete_zone(domain)
true
end
|
#domain=(new_domain) ⇒ Object
30
31
32
|
# File 'lib/fog/dynect/models/dns/zone.rb', line 30
def domain=(new_domain)
attributes[:domain] = new_domain.split('/').last
end
|
#nameservers ⇒ Object
44
45
46
|
# File 'lib/fog/dynect/models/dns/zone.rb', line 44
def nameservers
raise 'nameservers Not Implemented'
end
|
#publish ⇒ Object
34
35
36
37
38
|
# File 'lib/fog/dynect/models/dns/zone.rb', line 34
def publish
requires :identity
data = service.put_zone(identity, 'publish' => true)
true
end
|
#records ⇒ Object
40
41
42
|
# File 'lib/fog/dynect/models/dns/zone.rb', line 40
def records
@records ||= Fog::DNS::Dynect::Records.new(:zone => self, :service => service)
end
|
#save ⇒ Object
48
49
50
51
52
53
54
|
# File 'lib/fog/dynect/models/dns/zone.rb', line 48
def save
self.ttl ||= 3600
requires :domain, :email, :ttl
data = service.post_zone(email, ttl, domain).body['data']
merge_attributes(data)
true
end
|