lib/minuteman/bit_operations.rb in minuteman-0.2.0 vs lib/minuteman/bit_operations.rb in minuteman-1.0.0.pre
- old
+ new
@@ -71,15 +71,21 @@
#
def getbit(id)
redis.getbit(key, id) == 1
end
- # Private: executes an operation between the current timespan and another
+ # Private: Cxecutes an operation between the current timespan and another
#
# type: The operation type
# timespan: The given timespan
#
def operation(type, timespan)
- Operation.new(redis, type, self, timespan).call
+ operate.call(type, timespan)
+ end
+
+ # Private: Memoizes the operation class
+ #
+ def operate
+ @_operate ||= Operation.new(redis, self)
end
end
end