Class: Fog::Bluebox::DNS::Zone

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

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#inspect, #reload, #to_json, #wait_for

Methods included from Attributes::ClassMethods

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

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #identity, #identity=, #merge_attributes, #new_record?, #requires

Constructor Details

#initialize(attributes = {}) ⇒ Zone

Returns a new instance of Zone.



21
22
23
# File 'lib/fog/dns/models/bluebox/zone.rb', line 21

def initialize(attributes = {})
  super(attributes)
end

Instance Method Details

#destroyObject

Raises:



25
26
27
# File 'lib/fog/dns/models/bluebox/zone.rb', line 25

def destroy
  raise Fog::Errors::Error.new('Not implemented')
end

#nameserversObject



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

def nameservers
  [
    'ns1.blueblxgrid.com',
    'ns2.blueblxgrid.com',
    'ns3.blueblxgrid.com'
  ]
end

#recordsObject



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

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

#saveObject



52
53
54
55
56
57
58
59
# File 'lib/fog/dns/models/bluebox/zone.rb', line 52

def save
  requires :domain, :ttl
  options = attributes.dup
  options[:name] = options.delete(:domain)
  data = identity.nil? ? connection.create_zone(options) : connection.update_zone(identity, options)
  merge_attributes(data.body)
  true
end