Class: RecordStore::Record::MX
- Inherits:
-
RecordStore::Record
- Object
- RecordStore::Record
- RecordStore::Record::MX
- Defined in:
- lib/record_store/record/mx.rb
Constant Summary
Constants inherited from RecordStore::Record
Instance Attribute Summary collapse
-
#exchange ⇒ Object
Returns the value of attribute exchange.
-
#preference ⇒ Object
Returns the value of attribute preference.
Attributes inherited from RecordStore::Record
Instance Method Summary collapse
-
#initialize(record) ⇒ MX
constructor
A new instance of MX.
- #rdata ⇒ Object
- #to_s ⇒ Object
Methods inherited from RecordStore::Record
#==, build_from_yaml_definition, ensure_ends_with_dot, #hash, #key, #log!, #to_hash, #to_json, #type
Constructor Details
#initialize(record) ⇒ MX
Returns a new instance of MX.
8 9 10 11 12 |
# File 'lib/record_store/record/mx.rb', line 8 def initialize(record) super @exchange = Record.ensure_ends_with_dot(record.fetch(:exchange)) @preference = record.fetch(:preference) end |
Instance Attribute Details
#exchange ⇒ Object
Returns the value of attribute exchange.
3 4 5 |
# File 'lib/record_store/record/mx.rb', line 3 def exchange @exchange end |
#preference ⇒ Object
Returns the value of attribute preference.
3 4 5 |
# File 'lib/record_store/record/mx.rb', line 3 def preference @preference end |
Instance Method Details
#rdata ⇒ Object
14 15 16 17 18 19 |
# File 'lib/record_store/record/mx.rb', line 14 def rdata { preference: preference, exchange: exchange } end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/record_store/record/mx.rb', line 21 def to_s "[MXRecord] #{fqdn} #{ttl} IN MX #{preference} #{exchange}" end |