Class: Clouddns::Record
- Inherits:
-
Object
- Object
- Clouddns::Record
- Defined in:
- lib/clouddns/record.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
(also: #to_hash)
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(type, name, value, options = {}) ⇒ Record
constructor
A new instance of Record.
- #name ⇒ Object
- #ttl ⇒ Object
- #type ⇒ Object
- #value ⇒ Object
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, = {} value = [value] unless value.is_a? Array [:ttl] ||= 600 self.attributes = .merge({ :type => type, :name => name, :value => value }) end |
Instance Attribute Details
#attributes ⇒ Object 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
#name ⇒ Object
18 |
# File 'lib/clouddns/record.rb', line 18 def name; attributes[:name]; end |
#ttl ⇒ Object
21 |
# File 'lib/clouddns/record.rb', line 21 def ttl; attributes[:ttl]; end |
#type ⇒ Object
20 |
# File 'lib/clouddns/record.rb', line 20 def type; attributes[:type]; end |
#value ⇒ Object
19 |
# File 'lib/clouddns/record.rb', line 19 def value; attributes[:value]; end |