Class: Glare::DnsRecord
- Inherits:
-
Object
- Object
- Glare::DnsRecord
- Includes:
- Comparable
- Defined in:
- lib/glare/dns_record.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #<=>(dns_record) ⇒ Object
-
#initialize(name:, type:, content:) ⇒ DnsRecord
constructor
A new instance of DnsRecord.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, type:, content:) ⇒ DnsRecord
Returns a new instance of DnsRecord.
5 6 7 8 9 |
# File 'lib/glare/dns_record.rb', line 5 def initialize(name:, type:, content:) @name = name @type = type @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
25 26 27 |
# File 'lib/glare/dns_record.rb', line 25 def content @content end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
25 26 27 |
# File 'lib/glare/dns_record.rb', line 25 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
25 26 27 |
# File 'lib/glare/dns_record.rb', line 25 def type @type end |
Instance Method Details
#<=>(dns_record) ⇒ Object
19 20 21 22 23 |
# File 'lib/glare/dns_record.rb', line 19 def <=>(dns_record) @type <=> dns_record.type && @name <=> dns_record.name && @content <=> dns_record.content end |
#to_h ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/glare/dns_record.rb', line 11 def to_h { type: @type, name: @name, content: @content } end |