{"id":26510107,"url":"https://github.com/timcraft/minimodel","last_synced_at":"2025-03-21T01:40:11.652Z","repository":{"id":1701076,"uuid":"2429694","full_name":"timcraft/minimodel","owner":"timcraft","description":"Ruby gem for defining read-only models","archived":false,"fork":false,"pushed_at":"2024-01-11T15:11:02.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T23:15:36.602Z","etag":null,"topics":["rails","ruby","yaml"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timcraft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-09-21T12:55:29.000Z","updated_at":"2023-01-18T10:29:24.000Z","dependencies_parsed_at":"2023-02-10T02:45:37.128Z","dependency_job_id":null,"html_url":"https://github.com/timcraft/minimodel","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timcraft%2Fminimodel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timcraft%2Fminimodel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timcraft%2Fminimodel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timcraft%2Fminimodel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timcraft","download_url":"https://codeload.github.com/timcraft/minimodel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244722655,"owners_count":20499151,"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","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":["rails","ruby","yaml"],"created_at":"2025-03-21T01:40:11.157Z","updated_at":"2025-03-21T01:40:11.640Z","avatar_url":"https://github.com/timcraft.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# minimodel\n\n[![Gem Version](https://badge.fury.io/rb/minimodel.svg)](https://badge.fury.io/rb/minimodel) [![Test Status](https://github.com/timcraft/minimodel/actions/workflows/test.yml/badge.svg)](https://github.com/timcraft/minimodel/actions/workflows/test.yml)\n\n\nRuby gem for defining read-only models.\n\n\n## Installation\n\n    $ gem install minimodel\n\n\n## Motivation\n\nMany apps use small \"read only\" datasets that can easily be held in memory,\nfor example: currency data, country data, colour data, advertising banners,\noptions for select boxes, payment plans etc. Sometimes it's useful to model\nthis data without using a database, and that's what minimodel is for.\n\n\n## Example\n\nHere's how you could implement a currency model using minimodel:\n\n```ruby\nrequire 'minimodel'\n\nclass Currency \u003c MiniModel\n  indexed_by :code\n\n  insert code: 'EUR', name: 'Euro'\n  insert code: 'GBP', name: 'Pound sterling'\n  insert code: 'USD', name: 'United States dollar'\nend\n```\n\nThe Currency class will respond to `#count` (returning the total number of\ncurrencies), `#all` (returning an array of currency objects), and `#find`\n(to lookup a specific currency by its code). Similar to ActiveRecord.\n\nThere's also a `load_from` class method which will load data from a YAML\nfile; useful for when you'd rather store the raw data outside of the class.\n\nTake a look at `spec/*_spec.rb` for more examples. Have fun!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimcraft%2Fminimodel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimcraft%2Fminimodel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimcraft%2Fminimodel/lists"}