lib/zold/id.rb in zold-0.0.6 vs lib/zold/id.rb in zold-0.0.7

- old
+ new

@@ -27,9 +27,15 @@ class Id def initialize(id = nil) @id = id.nil? ? rand(2**32..2**64 - 1) : Integer("0x#{id}", 16) end + ROOT = Id.new('0000000000000000') + + def==(other) + to_s == other.to_s + end + def to_s format('%016x', @id) end end end