granola-schema 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02cf64484c5f354c2a89a84f30e1ca45a304c8c0
|
4
|
+
data.tar.gz: fa604062d1279a33bad7eb7eb70844e0a2311754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1adb7a313efb88297ff27fb377479c17c91b02d9c11c2dff31635ce6ed92cbb66fd8693ec54c2a09da0f3743160ad49fbb8220c858d2d3772da244ebd295ac6a
|
7
|
+
data.tar.gz: 344ab9d3184b53f732eb3d6b5b9f40ef6b7441019b354c6748bc17f64b31f663b2864663775921544e3dc876c6e08649927405190ffbb19c9ffff31c7666a75a
|
data/README.md
CHANGED
@@ -30,16 +30,13 @@ PersonSerializer.new(person).to_json #=> '{"name":"John Doe",...}'
|
|
30
30
|
## JSON serialization
|
31
31
|
|
32
32
|
Granola doesn't make assumptions about your code, so it shouldn't depend on a
|
33
|
-
specific JSON backend. It
|
34
|
-
|
33
|
+
specific JSON backend. It defaults to the native JSON backend, but you're free
|
34
|
+
to change it. For example, if you were using [Yajl][]:
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
If you want to pass options to `MultiJson` (like `pretty: true`), any keywords
|
40
|
-
passed to `#to_json` will be forwarded to `MultiJson.dump`.
|
36
|
+
``` ruby
|
37
|
+
Granola.json = ->(obj, **opts) { Yajl::Encoder.encode(obj, opts) }
|
38
|
+
```
|
41
39
|
|
42
|
-
[MultiJson]: https://github.com/intridea/multi_json
|
43
40
|
[Yajl]: https://github.com/brianmario/yajl-ruby
|
44
41
|
|
45
42
|
## Handling lists of models
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: granola-schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Sanguinetti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: granola
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json-schema
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|