Commit 0af7e56

mo <mo.khan@gmail.com>
2018-04-29 19:47:19
add find_by_value
1 parent 290af33
Changed files (1)
lib/del/repository.rb
@@ -13,6 +13,10 @@ module Del
       @lock.synchronize { @storage[id.to_s] }
     end
 
+    def find_by_value
+      @lock.synchronize { @storage.values.find { |x| yield x } }
+    end
+
     def find_all
       @lock.synchronize { @storage.keys }
     end