lib/rufus/tokyo/cabinet/abstract.rb
def incr (key, inc=1)

      key = key.to_s

      v = inc.is_a?(Fixnum) ?
        lib.addint(@db, key, Rufus::Tokyo.blen(key), inc) :
        lib.adddouble(@db, key, Rufus::Tokyo.blen(key), inc)

      raise(TokyoError.new(
        "incr failed, there is probably already a string value set " +
        "for the key '#{key}'. Make sure there is no value before incrementing"
      )) if v == Rufus::Tokyo::INT_MIN || (v.respond_to?(:nan?) && v.nan?)

      v
    end
def incr (key, inc=1)

      key = key.to_s

      v = inc.is_a?(Fixnum) ?
        lib.addint(@db, key, Rufus::Tokyo.blen(key), inc) :
        lib.adddouble(@db, key, Rufus::Tokyo.blen(key), inc)

      raise(TokyoError.new(
        "incr failed, there is probably already a string value set " +
        "for the key '#{key}'. Make sure there is no value before incrementing"
      )) if v == Rufus::Tokyo::INT_MIN || (v.respond_to?(:nan?) && v.nan?)

      v
    end
Increments the value stored under the given key with the given increment
 (defaults to 1 (integer)).

 Accepts an integer or a double value.

 Warning : Tokyo Cabinet/Tyrant doesn't store counter values as regular
 strings (db['key'] won't yield something that replies properly to #to_i)

 Use #counter_value(k) to get the current value set for the counter.