Class: ProviderDSL::Record
- Inherits:
-
Object
- Object
- ProviderDSL::Record
- Defined in:
- lib/provider_dsl/record.rb
Overview
Manage a DNS record
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#ttl ⇒ Object
readonly
Returns the value of attribute ttl.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #===(other) ⇒ Object
-
#initialize(name, type, value, ttl) ⇒ Record
constructor
A new instance of Record.
- #to_s ⇒ Object
Constructor Details
#initialize(name, type, value, ttl) ⇒ Record
Returns a new instance of Record.
6 7 8 9 10 11 12 |
# File 'lib/provider_dsl/record.rb', line 6 def initialize(name, type, value, ttl) @name = name @type = type @value = value @ttl = ttl @hash = { name: name, type: type, value: value, ttl: ttl } end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
4 5 6 |
# File 'lib/provider_dsl/record.rb', line 4 def hash @hash end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/provider_dsl/record.rb', line 4 def name @name end |
#ttl ⇒ Object (readonly)
Returns the value of attribute ttl.
4 5 6 |
# File 'lib/provider_dsl/record.rb', line 4 def ttl @ttl end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/provider_dsl/record.rb', line 4 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/provider_dsl/record.rb', line 4 def value @value end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/provider_dsl/record.rb', line 18 def ==(other) self === other && ttl == other.ttl end |
#===(other) ⇒ Object
22 23 24 |
# File 'lib/provider_dsl/record.rb', line 22 def ===(other) name == other.name && type == other.type && value == other.value end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/provider_dsl/record.rb', line 14 def to_s "#{ttl} #{name} #{type} #{value}" end |