Module: Async::DNS::Replace
- Defined in:
- lib/async/dns/replace.rb
Class Attribute Summary collapse
-
.resolver ⇒ Object
Returns the value of attribute resolver.
Class Method Summary collapse
Class Attribute Details
.resolver ⇒ Object
Returns the value of attribute resolver.
27 28 29 |
# File 'lib/async/dns/replace.rb', line 27 def resolver @resolver end |
Class Method Details
.get_address(host) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/async/dns/replace.rb', line 33 def get_address(host) begin resolver.addresses_for(host).sample.to_s rescue ResolutionFailure raise SocketError, "Hostname not known: #{host}" end end |
.resolver? ⇒ Boolean
29 30 31 |
# File 'lib/async/dns/replace.rb', line 29 def resolver? resolver != nil end |