lib/rufus/tokyo/cabinet/util.rb
def [] (i, count=nil)

      return nil if (count != nil) && count < 1

      len = self.size

      range = if count.nil?
        i.is_a?(Range) ? i : [i]
      else
        (i..i + count - 1)
      end

      r = norm(range).collect { |ii| outlen_op(:tclistval, ii) }

      range.first == range.last ? r.first : r
    end
def [] (i, count=nil)

      return nil if (count != nil) && count < 1

      len = self.size

      range = if count.nil?
        i.is_a?(Range) ? i : [i]
      else
        (i..i + count - 1)
      end

      r = norm(range).collect { |ii| outlen_op(:tclistval, ii) }

      range.first == range.last ? r.first : r
    end
The equivalent of Ruby Array#[]