Class: Clouddns::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/clouddns/record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, name, value, options = {}) ⇒ Record

Returns a new instance of Record.



7
8
9
10
11
12
13
14
15
16
# File 'lib/clouddns/record.rb', line 7

def initialize type, name, value, options = {}
  value = [value] unless value.is_a? Array
  options[:ttl] ||= 600

  self.attributes = options.merge({
    :type => type,
    :name => name,
    :value => value
  })
end

Instance Attribute Details

#attributesObject Also known as: to_hash

Returns the value of attribute attributes.



4
5
6
# File 'lib/clouddns/record.rb', line 4

def attributes
  @attributes
end

Instance Method Details

#nameObject



18
# File 'lib/clouddns/record.rb', line 18

def name;  attributes[:name]; end

#ttlObject



21
# File 'lib/clouddns/record.rb', line 21

def ttl;   attributes[:ttl]; end

#typeObject



20
# File 'lib/clouddns/record.rb', line 20

def type;  attributes[:type]; end

#valueObject



19
# File 'lib/clouddns/record.rb', line 19

def value; attributes[:value]; end