# File lib/Dnsruby/resource/resource.rb, line 66
    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 = RR.create(r.to_s) # clone the record
      r = nil
      if do_clone
        r = rin.clone
      else
        r = rin
      end
      if (@rrs.size() == 0) #  && !(r.type == Types.RRSIG))
        return privateAdd(r)
      end
      # Check the type, klass and ttl are correct
      first = @rrs[0]
      if (!r.sameRRset(first))
        return false
        #        raise ArgumentError.new("record does not match rrset")
      end
      
      if (!(r.type == Types::RRSIG) && (!(first.type == Types::RRSIG)))
        if (r.ttl != first.ttl) # RFC2181, section 5.2
          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)
      #      return true
    end