Method: Net::DNS::Question#inspect

Defined in:
lib/net/dns/question.rb

#inspectObject

call-seq:

question.inspect -> string

Returns a printable version of question with nice formatting.

q = Net::DNS::Question.new("google.com.", Net::DNS::A)
q.inspect # => "google.com.                  IN      A       "


126
127
128
129
130
131
132
133
# File 'lib/net/dns/question.rb', line 126

def inspect
  len = if @qName.size > 29
    @qName.size + 1
  else
    29
  end
  [@qName, @qClass.to_s, @qType.to_s].pack("A#{len} A8 A8")
end