vendor/bundle/ruby/2.7.0/gems/dnsruby-1.61.5/lib/dnsruby/resource/RRSet.rb
# Add the RR to this RRSet
# Takes a copy of the RR by default. To suppress this, pass false
# as the second parameter.
Add the RR to this RRSet
Takes a copy of the RR by default. To suppress this, pass false
as the second parameter.
Add the RR to this RRSet Takes a copy of the RR by default . To suppress this pass false as the second parameter .
def add(rin, do_clone = true)
    if (rin.instance_of?RRSet)
      ret = false
      [rin.rrs, rin.sigs].each {|rr| ret = add(rr)}
      return ret
    end
    r = nil
    if do_clone
      r = rin.clone
    else
      r = rin
    end
    if (@rrs.size() == 0) 
      return privateAdd(r)
    end
    first = @rrs[0]
    if (!r.sameRRset(first))
      return false
    end
    if (!(r.type == Types::RRSIG) && (!(first.type == Types::RRSIG)))
      if (r.ttl != first.ttl) 
        if (r.ttl > first.ttl)
          r.ttl=(first.ttl)
        else
          @rrs.each do |rr|
            rr.ttl = r.ttl
          end
        end
      end
    end
    return privateAdd(r)
  end
def add ( rin , do_clone = true ) if ( rin . instance_of? RRSet ) ret = false [ rin . rrs , rin . sigs ] . each { | rr | ret = add ( rr ) } return ret end r = nil if do_clone r = rin . clone else r = rin end if ( @rrs . size ( ) == 0 ) return privateAdd ( r ) end first = @rrs [ 0 ] if ( ! r . sameRRset ( first ) ) return false end if ( ! ( r . type == Types :: RRSIG ) && ( ! ( first . type == Types :: RRSIG ) ) ) if ( r . ttl != first . ttl ) if ( r . ttl > first . ttl ) r . ttl = ( first . ttl ) else @rrs . each do | rr | rr . ttl = r . ttl end end end end return privateAdd ( r ) end
Add the RR to this RRSet
Takes a copy of the RR by default.
Add the RR to this RRSet Takes a copy of the RR by default .
#       r = RR.create(r.to_s) # clone the record #  && !(r.type == Types.RRSIG)) #  Check the type, klass and ttl are correct #         raise ArgumentError.new("record does not match rrset") # RFC2181, section 5.2 #       return true
rin
<not_specific>
do_clone
<not_specific>