Class: Fog::DNS::Dynect::Zone
- Inherits:
-
Model
- Object
- Model
- Fog::DNS::Dynect::Zone
- Defined in:
- lib/fog/dynect/models/dns/zone.rb
Instance Method Summary collapse
- #destroy ⇒ Object
- #domain=(new_domain) ⇒ Object
-
#initialize(attributes = {}) ⇒ Zone
constructor
A new instance of Zone.
- #nameservers ⇒ Object
- #publish ⇒ Object
- #records ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Zone
Returns a new instance of Zone.
17 18 19 |
# File 'lib/fog/dynect/models/dns/zone.rb', line 17 def initialize(attributes={}) super end |
Instance Method Details
#destroy ⇒ Object
21 22 23 24 25 |
# File 'lib/fog/dynect/models/dns/zone.rb', line 21 def destroy requires :domain service.delete_zone(domain) true end |
#domain=(new_domain) ⇒ Object
28 29 30 |
# File 'lib/fog/dynect/models/dns/zone.rb', line 28 def domain=(new_domain) attributes[:domain] = new_domain.split('/').last end |
#nameservers ⇒ Object
42 43 44 |
# File 'lib/fog/dynect/models/dns/zone.rb', line 42 def nameservers raise 'nameservers Not Implemented' end |
#publish ⇒ Object
32 33 34 35 36 |
# File 'lib/fog/dynect/models/dns/zone.rb', line 32 def publish requires :identity data = service.put_zone(identity, 'publish' => true) true end |
#records ⇒ Object
38 39 40 |
# File 'lib/fog/dynect/models/dns/zone.rb', line 38 def records @records ||= Fog::DNS::Dynect::Records.new(:zone => self, :service => service) end |
#save ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/fog/dynect/models/dns/zone.rb', line 46 def save self.ttl ||= 3600 requires :domain, :email, :ttl data = service.post_zone(email, ttl, domain).body['data'] merge_attributes(data) true end |