Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elcuervo/spirit
https://github.com/elcuervo/spirit
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/elcuervo/spirit
- Owner: elcuervo
- Created: 2012-02-01T19:42:49.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-03-29T18:04:07.000Z (almost 13 years ago)
- Last Synced: 2024-11-28T23:28:30.116Z (about 1 month ago)
- Language: Ruby
- Homepage:
- Size: 113 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spirit
![Spirit](https://github.com/elcuervo/spirit/raw/master/docs/img/spirit.jpg)
Resources represented as models
## Currently Implemented
* has_one
* belongs_to
* has_many## Example
```ruby
class Bro < Spirit::Model
attribute :name
attribute :genderhas_one :room, Room
endclass Room << Spirit::Model
attribute :address
attribute :newbelongs_to :owner, Bro
endbro = Bro.create(name: 'Barney')
room = Room.create(address: 'Somewhere', owner: bro)room.owner == bro
# => true
```