Class: Dynectastic::Record

Inherits:
Resource show all
Defined in:
lib/dynectastic/record.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#factory, #last_request, #session

Instance Method Summary collapse

Methods inherited from Resource

#attributes=, #delete, #get, #initialize, #post, #put

Constructor Details

This class inherits a constructor from Dynectastic::Resource

Instance Attribute Details

#nodeObject

Returns the value of attribute node.



5
6
7
# File 'lib/dynectastic/record.rb', line 5

def node
  @node
end

#rdataObject

Returns the value of attribute rdata.



5
6
7
# File 'lib/dynectastic/record.rb', line 5

def rdata
  @rdata
end

#record_idObject

Returns the value of attribute record_id.



5
6
7
# File 'lib/dynectastic/record.rb', line 5

def record_id
  @record_id
end

#ttlObject

Returns the value of attribute ttl.



5
6
7
# File 'lib/dynectastic/record.rb', line 5

def ttl
  @ttl
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/dynectastic/record.rb', line 5

def type
  @type
end

#zoneObject

Returns the value of attribute zone.



5
6
7
# File 'lib/dynectastic/record.rb', line 5

def zone
  @zone
end

Instance Method Details

#saveObject



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

def save
  payload = {
    'rdata' => rdata,
    'ttl'   => ttl
  }

  self.attributes = record_id ? update(payload) : create(payload)
end