class Fog::DNS::Linode::Record

Public Class Methods

new(attributes={}) click to toggle source

“PROTOCOL”:“”, “WEIGHT”:0, “PORT”:0,

Calls superclass method Fog::Model.new
# File lib/fog/linode/models/dns/record.rb, line 25
def initialize(attributes={})
  self.ttl    ||= 3600
  super
end

Public Instance Methods

destroy() click to toggle source
# File lib/fog/linode/models/dns/record.rb, line 30
def destroy
  requires :identity, :zone
  connection.domain_resource_delete(zone.id, identity)
  true
end
save() click to toggle source
# File lib/fog/linode/models/dns/record.rb, line 40
def save
  requires :type, :zone
  options = {}
  # * options<~Hash>
  #   * weight<~Integer>: default: 5
  #   * port<~Integer>: default: 80 
  #   * protocol<~String>: The protocol to append to an SRV record. Ignored on other record 
  #                        types. default: udp
  options[:name]      = name if name
  options[:priority]  = priority if priority
  options[:target]    = value if value
  options[:ttl_sec]   = ttl if ttl
  response = unless identity
    connection.domain_resource_create(zone.identity, type, options)
  else
    options[:type] = type if type
    connection.domain_resource_update(zone.identity, identity, options)
  end
  merge_attributes(response.body['DATA'])
  true
end
zone() click to toggle source
# File lib/fog/linode/models/dns/record.rb, line 36
def zone
  @zone
end

Private Instance Methods

zone=(new_zone) click to toggle source
# File lib/fog/linode/models/dns/record.rb, line 64
def zone=(new_zone)
  @zone = new_zone
end