json_api_client 1.0.0.beta7 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/json_api_client/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 504a915e167e03afc41f0833ae2f235f5d238590
|
4
|
+
data.tar.gz: 3a7193339700330618b73beb46a92dc9d61f8f6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 673b870045a46928d53080e6020751d99bdaf7e82c76671f129d3f8c8f821503f5332991ef8758ee540c5af26236f0924045a75058e33e07c8c0f1f80de5c7af
|
7
|
+
data.tar.gz: 03c7ae9c6309a64215001a184bc8efdc1d48c765e095ab2856b23cffe535e27a8a5fd85a0962e714290b4c5f5dc34db7bafc8164e72afb668e1088917d7055e5
|
data/README.md
CHANGED
@@ -4,8 +4,6 @@ This gem is meant to help you build an API client for interacting with REST APIs
|
|
4
4
|
|
5
5
|
*Note: master is currently tracking the 1.0.0 specification. If you're looking for the older code, see [0.x branch](https://github.com/chingor13/json_api_client/tree/0.x)*
|
6
6
|
|
7
|
-
*Note: This is still a work in progress.*
|
8
|
-
|
9
7
|
## Usage
|
10
8
|
|
11
9
|
You will want to create your own resource classes that inherit from `JsonApiClient::Resource` similar to how you would create an `ActiveRecord` class. You may also want to create your own abstract base class to share common behavior. Additionally, you will probably want to namespace your models. Namespacing your model will not affect the url routing to that resource.
|
@@ -141,6 +139,8 @@ articles.links.related
|
|
141
139
|
|
142
140
|
You can force nested resource paths for your models by using a `belongs_to` association.
|
143
141
|
|
142
|
+
**Note: Using belongs_to is only necessary for setting a nested path.**
|
143
|
+
|
144
144
|
```
|
145
145
|
module MyApi
|
146
146
|
class Account < JsonApiClient::Resource
|
@@ -273,6 +273,8 @@ You can define schema within your client model. You can define basic types and s
|
|
273
273
|
|
274
274
|
The added benefit of declaring your schema is that you can access fields before data is set (otherwise, you'll get a `NoMethodError`).
|
275
275
|
|
276
|
+
**Note: This is completely optional. This will set default values and handle typecasting.**
|
277
|
+
|
276
278
|
### Example
|
277
279
|
|
278
280
|
```
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Ching
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -170,12 +170,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: '0'
|
171
171
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
172
|
requirements:
|
173
|
-
- - "
|
173
|
+
- - ">="
|
174
174
|
- !ruby/object:Gem::Version
|
175
|
-
version:
|
175
|
+
version: '0'
|
176
176
|
requirements: []
|
177
177
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.4.
|
178
|
+
rubygems_version: 2.4.5
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: Build client libraries compliant with specification defined by jsonapi.org
|