vendor/bundle/ruby/2.7.0/gems/dnsruby-1.61.5/lib/dnsruby/message/message.rb
#  Return the encoded form of the message
#  If there is a TSIG record present and the record has not been signed
#  then sign it
Return the encoded form of the message
If there is a TSIG record present and the record has not been signed
then sign it
Return the encoded form of the message If there is a TSIG record present and the record has not been signed then sign it
def encode(canonical=false)
      if @tsigkey && (@tsigstate == :Unsigned) && !@signing
        @signing = true
        sign!
        @signing = false
      end
      return MessageEncoder.new { |msg|
        header = @header
        header.encode(msg)
        @question.each { |q|
          msg.put_name(q.qname)
          msg.put_pack('nn', q.qtype.code, q.qclass.code)
        }
        [@answer, @authority, @additional].each { |rr|
          rr.each { |r|
            msg.put_rr(r, canonical)
          }
        }
      }.to_s
    end
def encode ( canonical = false ) if @tsigkey && ( @tsigstate == :Unsigned ) && ! @signing @signing = true sign! @signing = false end return MessageEncoder . new { | msg | header = @header header . encode ( msg ) @question . each { | q | msg . put_name ( q . qname ) msg . put_pack ( 'nn' , q . qtype . code , q . qclass . code ) } [ @answer , @authority , @additional ] . each { | rr | rr . each { | r | msg . put_rr ( r , canonical ) } } } . to_s end
Return the encoded form of the message
If there is a TSIG record present and the record has not been signed
then sign it
Return the encoded form of the message If there is a TSIG record present and the record has not been signed then sign it
canonical
<not_specific>