jsonapi-object-mapper 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -4
- data/lib/jsonapi-object-mapper/deserialize/collection.rb +0 -1
- data/lib/jsonapi-object-mapper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13f9a7b828f1b92f507cc28cf7eb65cbf697042669846a11ac0099aa6b6f24b6
|
4
|
+
data.tar.gz: 9dfb0ad00761af92d00c87062fb60399f19989f3f13d989abd7c046676509896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cd208aa8aa699060367018cd73e0c8263e3f45839de720e6983a8400c8c4056c1300e846c3933729c227f3c03e37107a02f2b829a899d84b9aa24a6f9d276fd
|
7
|
+
data.tar.gz: 637cf774585df3d34fc84aa64d6f252066135c1df09316e797dbf2c71732ffbe74b98b844e7cfc7c469c9a7b8954888b6a256f310c29d7225535f730a5b8d9f5
|
data/README.md
CHANGED
@@ -38,6 +38,8 @@ class User < JsonAPIObjectMapper::Deserialize::Resource
|
|
38
38
|
# - IE: { "type" = "friend", "id" = "10" }
|
39
39
|
has_one :friend
|
40
40
|
|
41
|
+
has_many :enemies, embed_with: User
|
42
|
+
|
41
43
|
# This will accept the default value
|
42
44
|
attribute :last_name
|
43
45
|
|
@@ -55,6 +57,7 @@ user = User.call(json_payload) #=> <#User:123>
|
|
55
57
|
|
56
58
|
user.first_name #=> "FOOER"
|
57
59
|
user.last_name #=> "Bar"
|
60
|
+
user.enemies #=> <# JsonAPIObjectMapper::Deserialize::Collection #>
|
58
61
|
|
59
62
|
# If json API Payload is a collection of data points
|
60
63
|
users = User.call(json_payload) #=> <# JsonAPIObjectMapper::Deserialize::Collection #>
|
@@ -85,10 +88,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
85
88
|
|
86
89
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
87
90
|
|
88
|
-
## Contributing
|
89
|
-
|
90
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/georgekaraszi@gmail.com/jsonapi_object_mapper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
91
|
-
|
92
91
|
## License
|
93
92
|
|
94
93
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi-object-mapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Protacio-Karaszi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|