Permalink
Browse files

GCounter: add a + method.

+ increments a GCounter using the current Meangirls global node ID.
  • Loading branch information...
1 parent 16af7aa commit 8903c6a87c0b13100a0eea075fd727cb1bc0527b @aphyr committed May 26, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/meangirls/g_counter.rb
@@ -37,6 +37,11 @@ def increment(node = 1, delta = 1)
self
end
+ # Adds delta to this counter, using the current Meangirls node ID.
+ def +(delta)
+ increment Meangirls.node, delta
+ end
+
def clone
c = super
c.e = @e.clone

0 comments on commit 8903c6a

Please sign in to comment.