Class: Matchd::Response::MX
- Inherits:
-
Matchd::Response
- Object
- Matchd::Response
- Matchd::Response::MX
- Defined in:
- lib/matchd/response/mx.rb
Constant Summary
Constants inherited from Matchd::Response
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#preference ⇒ Object
readonly
Returns the value of attribute preference.
Attributes inherited from Matchd::Response
Instance Method Summary collapse
-
#initialize(opts) ⇒ MX
constructor
A new instance of MX.
- #resource ⇒ Object
Methods inherited from Matchd::Response
Constructor Details
#initialize(opts) ⇒ MX
Returns a new instance of MX.
2 3 4 5 6 |
# File 'lib/matchd/response/mx.rb', line 2 def initialize(opts) super @preference = opts.fetch("preference") @host = opts.fetch("host") end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
8 9 10 |
# File 'lib/matchd/response/mx.rb', line 8 def host @host end |
#preference ⇒ Object (readonly)
Returns the value of attribute preference.
8 9 10 |
# File 'lib/matchd/response/mx.rb', line 8 def preference @preference end |
Instance Method Details
#resource ⇒ Object
10 11 12 13 14 15 |
# File 'lib/matchd/response/mx.rb', line 10 def resource Resolv::DNS::Resource::IN::MX.new( preference, Resolv::DNS::Name.create(host), ) end |