# File lib/Dnsruby/message.rb, line 112 def rrsets(type = nil, include_opt = false) if (type && !(Types === type)) type = Types.new(type) end ret = [] each do |rr| next if (!include_opt && (rr.type == Types::OPT)) # if (type) # next if ((rr.type == Types.RRSIG) && (type != Types.RRSIG) && (rr.type_covered != type)) # next if (rr.type != type) # end if (type) # if this is an rrsig type, then : # only include it if the type_covered is the type requested, # OR if the type requested is an RRSIG if (rr.type == Types::RRSIG) if ((rr.type_covered == type) || (type == Types::RRSIG)) else next end # next if ((rr.type_covered != type) || (type != Types.RRSIG)) elsif (rr.type != type) next end end found_rrset = false ret.each do |rrset| found_rrset = rrset.add(rr) break if found_rrset end if (!found_rrset) ret.push(RRSet.new(rr)) end end return ret end