Skip to content

Comment on Gibbler: Git-like Hashes and History for Ruby Objectsparent

Comments

Yes, the class is not responsible for managing any aspect of its storage. It can provide hints, however, and that's what the "ID" and "Immutable" roles do.

It is worth pointing out that no automatic hashing is occurring. You write a function that is invoked on an instance of the class that determines the unique ID. You decide the content-addressibility of your object by choosing the address based on the content.

(If you just want a unique ID per object, KiokuDB assigns a UUID by default as the ID.)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.