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
- #rdata_txt ⇒ Object
Methods inherited from RecordStore::Record
#==, build_from_yaml_definition, ensure_ends_with_dot, ensure_ends_without_dot, escape, #hash, #key, #log!, long_quote, needs_long_quotes?, quote, #to_hash, #to_json, #to_s, #type, unescape, unlong_quote, unquote, #wildcard?
Constructor Details
#initialize(record) ⇒ MX
Returns a new instance of MX.
16 17 18 19 20 |
# File 'lib/record_store/record/mx.rb', line 16 def initialize(record) super @exchange = Record.ensure_ends_with_dot(record.fetch(:exchange)) @preference = Integer(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
22 23 24 25 26 27 |
# File 'lib/record_store/record/mx.rb', line 22 def rdata { preference: preference, exchange: exchange, } end |
#rdata_txt ⇒ Object
29 30 31 |
# File 'lib/record_store/record/mx.rb', line 29 def rdata_txt "#{preference} #{exchange}" end |