lib/couchbase/model/uuid.rb in couchbase-model-0.0.1 vs lib/couchbase/model/uuid.rb in couchbase-model-0.1.0
- old
+ new
@@ -21,27 +21,37 @@
class Model
# Generator of CouchDB specfic UUIDs. This is the ruby implementation of
# couch_uuids.erl from couchdb distribution. It is threadsafe.
+ #
+ # @since 0.0.1
class UUID
# Get default UUID generator. You can create your own if you like.
+ #
+ # @since 0.0.1
+ #
+ # @return [UUID]
def self.generator
@generator ||= UUID.new
end
# Initialize generator.
#
+ # @since 0.0.1
+ #
# @param [Fixnum] seed seed for pseudorandom number generator.
def initialize(seed = nil)
seed ? srand(seed) : srand
@prefix, _ = rand_bytes(13).unpack("H26")
@inc = rand(0xfff) + 1
@lock = Mutex.new
end
# Generate list of UUIDs.
+ #
+ # @since 0.0.1
#
# @param [Fixnum] count number of UUIDs you need
#
# @param [Symbol] algorithm Algorithm to use. Known algorithms:
# [:random]