Class: DNSTraverse::Response::Loop

Inherits:
DNSTraverse::Response show all
Defined in:
lib/dnstraverse/response_loop.rb

Instance Attribute Summary collapse

Attributes inherited from DNSTraverse::Response

#decoded_query, #infocache, #starters, #starters_bailiwick, #stats_key

Instance Method Summary collapse

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

#bailiwickObject (readonly)

Returns the value of attribute bailiwick.



20
21
22
# File 'lib/dnstraverse/response_loop.rb', line 20

def bailiwick
  @bailiwick
end

#ipObject (readonly)

Returns the value of attribute ip.



20
21
22
# File 'lib/dnstraverse/response_loop.rb', line 20

def ip
  @ip
end

#qclassObject (readonly)

Returns the value of attribute qclass.



20
21
22
# File 'lib/dnstraverse/response_loop.rb', line 20

def qclass
  @qclass
end

#qnameObject (readonly)

Returns the value of attribute qname.



20
21
22
# File 'lib/dnstraverse/response_loop.rb', line 20

def qname
  @qname
end

#qtypeObject (readonly)

Returns the value of attribute qtype.



20
21
22
# File 'lib/dnstraverse/response_loop.rb', line 20

def qtype
  @qtype
end

#serverObject (readonly)

Returns the value of attribute server.



20
21
22
# File 'lib/dnstraverse/response_loop.rb', line 20

def server
  @server
end

#statusObject (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_sObject



44
45
46
# File 'lib/dnstraverse/response_loop.rb', line 44

def to_s
  return "Loop encountered resolving #{@server}"
end

#update_stats_keyObject



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