jsonapi
jsonapi
Provides the ability to map fields in an object and call to_jsonapi
. This will allow support for jsonapi.
Installation
Add this to your application's shard.yml
:
dependencies:
jsonapi:
github: drujensen/jsonapi
branch: master
Usage
include JSONAPI in a class. The class needs to have an @id defined.
Next, create a jsonapi_mapping
for the fields in your object.
require "jsonapi"
class Test
include JSONAPI
def initialize(@id = 0, @name = "", @body = "")
end
jsonapi_mapping({
name: String,
body: String
})
end
Development
This is a Work In Progress.
RoadMap:
- support links
- relationships
Contributing
- Fork it ( https://github.com/[your-github-name]/jsonapi/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- drujensen Dru Jensen - creator, maintainer
Repository
jsonapi
Owner
Statistic
- 1
- 0
- 0
- 0
- 0
- over 8 years ago
- March 26, 2016
License
MIT License
Links
Synced at
Thu, 07 Nov 2024 02:58:55 GMT
Languages