Class: DNSTraverse::Response::Loop
- Inherits:
-
DNSTraverse::Response
- Object
- DNSTraverse::Response
- DNSTraverse::Response::Loop
- Defined in:
- lib/dnstraverse/response_loop.rb
Instance Attribute Summary collapse
-
#bailiwick ⇒ Object
readonly
Returns the value of attribute bailiwick.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#qclass ⇒ Object
readonly
Returns the value of attribute qclass.
-
#qname ⇒ Object
readonly
Returns the value of attribute qname.
-
#qtype ⇒ Object
readonly
Returns the value of attribute qtype.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Attributes inherited from DNSTraverse::Response
#decoded_query, #infocache, #starters, #starters_bailiwick, #stats_key
Instance Method Summary collapse
-
#initialize(args) ⇒ Loop
constructor
A new instance of Loop.
- #method_missing(key, *args, &block) ⇒ Object
- #to_s ⇒ Object
- #update_stats_key ⇒ Object
Methods inherited from DNSTraverse::Response
#cleanup, #evaluate, #inside_bailiwick?
Constructor Details
#initialize(args) ⇒ Loop
Returns a new instance of Loop.
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dnstraverse/response_loop.rb', line 22 def initialize(args) # we queried @ip about @qname/@qclass/@qtype and received @server as a # referral in bailiwick @bailiwick but without any glue @qname = args[:qname] @qclass = args[:qclass] @qtype = args[:qtype] @bailiwick = args[:bailiwick] @ip = args[:ip] @server = args[:server] @status = :loop update_stats_key return self end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(key, *args, &block) ⇒ Object
36 37 38 |
# File 'lib/dnstraverse/response_loop.rb', line 36 def method_missing(key, *args, &block) super # there are no missing methods, we answer directly end |
Instance Attribute Details
#bailiwick ⇒ Object (readonly)
Returns the value of attribute bailiwick.
20 21 22 |
# File 'lib/dnstraverse/response_loop.rb', line 20 def bailiwick @bailiwick end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
20 21 22 |
# File 'lib/dnstraverse/response_loop.rb', line 20 def ip @ip end |
#qclass ⇒ Object (readonly)
Returns the value of attribute qclass.
20 21 22 |
# File 'lib/dnstraverse/response_loop.rb', line 20 def qclass @qclass end |
#qname ⇒ Object (readonly)
Returns the value of attribute qname.
20 21 22 |
# File 'lib/dnstraverse/response_loop.rb', line 20 def qname @qname end |
#qtype ⇒ Object (readonly)
Returns the value of attribute qtype.
20 21 22 |
# File 'lib/dnstraverse/response_loop.rb', line 20 def qtype @qtype end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
20 21 22 |
# File 'lib/dnstraverse/response_loop.rb', line 20 def server @server end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
20 21 22 |
# File 'lib/dnstraverse/response_loop.rb', line 20 def status @status end |
Instance Method Details
#to_s ⇒ Object
44 45 46 |
# File 'lib/dnstraverse/response_loop.rb', line 44 def to_s return "Loop encountered resolving #{@server}" end |
#update_stats_key ⇒ Object
40 41 42 |
# File 'lib/dnstraverse/response_loop.rb', line 40 def update_stats_key @stats_key = "key:#{@status}:#{@ip}:#{@qname}:#{@qclass}:#{@qtype}:#{@server}:#{@bailiwick}" end |