Class: Glare::DnsRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/glare/dns_record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, type:, content:, proxied:, ttl:) ⇒ DnsRecord

Returns a new instance of DnsRecord.



3
4
5
6
7
8
9
# File 'lib/glare/dns_record.rb', line 3

def initialize(name:, type:, content:, proxied:, ttl: )
  @name = name
  @type = type
  @content = content
  @proxied = proxied
  @ttl = ttl
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



29
30
31
# File 'lib/glare/dns_record.rb', line 29

def content
  @content
end

#nameObject (readonly)

Returns the value of attribute name.



29
30
31
# File 'lib/glare/dns_record.rb', line 29

def name
  @name
end

#proxiedObject (readonly)

Returns the value of attribute proxied.



29
30
31
# File 'lib/glare/dns_record.rb', line 29

def proxied
  @proxied
end

#ttlObject (readonly)

Returns the value of attribute ttl.



29
30
31
# File 'lib/glare/dns_record.rb', line 29

def ttl
  @ttl
end

#typeObject (readonly)

Returns the value of attribute type.



29
30
31
# File 'lib/glare/dns_record.rb', line 29

def type
  @type
end

Instance Method Details

#==(dns_record) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/glare/dns_record.rb', line 21

def ==(dns_record)
  @type == dns_record.type &&
    @name == dns_record.name &&
    @content == dns_record.content &&
    @proxied == dns_record.proxied &&
    @ttl == dns_record.ttl
end

#to_hObject



11
12
13
14
15
16
17
18
19
# File 'lib/glare/dns_record.rb', line 11

def to_h
  {
    type: @type,
    name: @name,
    content: @content,
    proxied: @proxied,
    ttl: @ttl
  }
end