Class: ProviderDSL::Record

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

Overview

Manage a DNS record

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hashObject (readonly)

Returns the value of attribute hash.



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

def hash
  @hash
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#ttlObject (readonly)

Returns the value of attribute ttl.



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

def ttl
  @ttl
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#valueObject (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_sObject



14
15
16
# File 'lib/provider_dsl/record.rb', line 14

def to_s
  "#{ttl} #{name} #{type} #{value}"
end