{"id":29955009,"url":"https://github.com/foca/vault","last_synced_at":"2025-08-03T17:09:15.095Z","repository":{"id":66265700,"uuid":"644604","full_name":"foca/vault","owner":"foca","description":"A lightweight Object Document Mapper based on ActiveModel","archived":false,"fork":false,"pushed_at":"2010-05-15T17:53:09.000Z","size":114,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-04-10T10:20:06.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-05-03T15:43:43.000Z","updated_at":"2013-10-17T18:57:04.000Z","dependencies_parsed_at":"2023-02-20T01:05:16.147Z","dependency_job_id":null,"html_url":"https://github.com/foca/vault","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/foca/vault","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foca%2Fvault","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foca%2Fvault/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foca%2Fvault/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foca%2Fvault/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foca","download_url":"https://codeload.github.com/foca/vault/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foca%2Fvault/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268578914,"owners_count":24273089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-03T17:09:10.525Z","updated_at":"2025-08-03T17:09:15.085Z","avatar_url":"https://github.com/foca.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Vault, a lightweight Object Document Mapper\n===========================================\n\n    class User\n      include Vault\n\n      key      :id\n      property :name\n      property :email\n    end\n\n    user = User.new(:id =\u003e 1, :name =\u003e \"John\", :email =\u003e \"john@example.org\")\n    user.save\n\n    User.find(1) #=\u003e user\n    User.all     #=\u003e [user]\n    User.size    #=\u003e 1\n\nStorage\n-------\n\nBy default Vault stores everything in an in-memory hash. Each model (class in\nwhich you included the `Vault` module) has its own, independent storage.\n\nSubclasses of a model share their storage with their parent.\n\nTo change the storage you can call `store_objects_in(store)` in the class\ndefinition. A store is any object that implements this API:\n\n* `Store#size` returns an integer with the total amount of elements in the store\n* `Store#each(\u0026block)` a store must implement `each` and include Enumerable\n* `Store#[](key)` receiving the key it should return a hash of all attributes\n**except for the key**.\n* `Store#[]=(key, attributes)` attributes will be a hash with the attributes\n**except** for the key.\n* `Store#delete(key)` shall delete the item without the given key.\n* `Store#filter(hash)` should return a new object of the same class as the\n  original store, but only with objects whose properties match those of the\n  argument.\n\nThis library provides two storage mechanisms out of the box:\n\n* `Vault::Storage::InMemoryStore` is a simple hash storage (and the default)\n* `Vault::Storage::YamlStore` serializes the contents to disk as a YAML file\n\nTODO\n----\n\n* Relationships/Associations\n\nMore docs?\n----------\n\nI will get to it eventually. For now, read the specs and the source—it is a\nsmall library. Or help and write some docs :)\n\nNote on Patches/Pull Requests\n-----------------------------\n\n* Fork the project.\n* Make your feature addition or bug fix.\n* Add tests for it. This is important so I don’t break it in a future version\n  unintentionally.\n* Commit, do not mess with Rakefile, version, or history. (if you want to have\n  your own version, that is fine but bump version in a commit by itself I can\n  ignore when I pull.)\n* Send me a pull request. Bonus points for topic branches.\n\nCopyright\n---------\n\nCopyright © 2010 [Nicolás Sanguinetti](http://github.com/foca), licensed under\nan MIT license. See MIT-LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoca%2Fvault","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoca%2Fvault","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoca%2Fvault/lists"}