{"id":21741575,"url":"https://github.com/m3talsmith/arkenstone","last_synced_at":"2025-04-13T03:42:17.697Z","repository":{"id":14036587,"uuid":"16738988","full_name":"m3talsmith/arkenstone","owner":"m3talsmith","description":"A lightweight ORM for RESTful services everywhere","archived":false,"fork":false,"pushed_at":"2024-05-16T20:31:40.000Z","size":262,"stargazers_count":1,"open_issues_count":5,"forks_count":18,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-26T20:51:31.116Z","etag":null,"topics":["arkenstone","orm","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"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/m3talsmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-02-11T17:31:54.000Z","updated_at":"2023-04-19T19:49:04.000Z","dependencies_parsed_at":"2022-08-28T23:12:50.869Z","dependency_job_id":"354c8a51-2436-48f7-a415-4fb4ac46bca5","html_url":"https://github.com/m3talsmith/arkenstone","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/m3talsmith%2Farkenstone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3talsmith%2Farkenstone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3talsmith%2Farkenstone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m3talsmith%2Farkenstone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m3talsmith","download_url":"https://codeload.github.com/m3talsmith/arkenstone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661071,"owners_count":21141390,"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":["arkenstone","orm","ruby"],"created_at":"2024-11-26T06:19:22.336Z","updated_at":"2025-04-13T03:42:17.675Z","avatar_url":"https://github.com/m3talsmith.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arkenstone [![Build Status](https://app.travis-ci.com/m3talsmith/arkenstone.svg?branch=development\u0026status=passed)](https://app.travis-ci.com/m3talsmith/arkenstone) [![Maintainability](https://api.codeclimate.com/v1/badges/a0f3b07d272fcf220475/maintainability)](https://codeclimate.com/github/m3talsmith/arkenstone/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/a0f3b07d272fcf220475/test_coverage)](https://codeclimate.com/github/m3talsmith/arkenstone/test_coverage)\n\nArkenstone is a replacement for [ActiveRecord](http://api.rubyonrails.org/classes/ActiveRecord/Base.html) that uses RESTful services to get and store data.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'arkenstone'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install arkenstone\n\n## Usage\n\nInclude the `Arkenstone::Document` module in your class, set the `url` and `attributes` and away you go.\n\n    class User\n      include Arkenstone::Document\n\n      url 'http://example.com/users/'\n      attributes :name, :age, :gender\n    end\n\n`User` instances will have accessor properties for `:name`, `:age`, and `:gender`. You can also `save`, and `update_attributes` as well:\n\n    my_user = User.create(name: 'Thorin', age: 195, gender: 'M', bearded: true)\n\nThis will make a `POST` to `http://example.com/users/`. If json data is returned from the server, it will be applied to the attributes of the object.\n\nHow about updating?\n\n    # Assuming Thorin has an id of 1\n    thorin = User.find(1)\n\n    # Thorin lost a bet and shaved... well you know how bets go!\n    thorin.update_attribute :bearded, false\n\nThis does a `PUT` to `http://example.com/users/1`. Again, returning json is translated back into a usable Thorin.\n\nYou can also change attributes using `#update_attributes` or setting them at a field level and saving.\n\n    # Thorin didn't shave for a day\n    thorin = User.find(1)\n    thorin.bearded = true\n    thorin.save\n\n`Arkenstone` knows if you're a new object or not and properly uses `POST` or `PUT` where needed.\n\nHere is a list of `RESTful` expectations that come with the library:\n\n```ruby\nModel.find(1)                                                               # =\u003e GET http://example.com/1\nModel.all                                                                   # =\u003e GET http://example.com\nModel.new.save                                                              # =\u003e POST http://example.com\nModel.find(1).save                                                          # =\u003e PUT http://example.com/1\nModel.find(1).update_attribute(:attribute, 'value')                         # =\u003e PUT http://example.com/1\nModel.find(1).update_attributes(attribute1: 'value1', attribute2: 'value2') # =\u003e PUT http://example.com/1\nModel.find(1).destroy                                                       # =\u003e DELETE http://example.com/1\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\n\nThe MIT License (MIT)\n\nArkenstone: a lightweight json active model like framework.\n\nCopyright (C) 2020 Michael Christenson II\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm3talsmith%2Farkenstone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm3talsmith%2Farkenstone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm3talsmith%2Farkenstone/lists"}