jinx-json 2.1.2 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/History.md +8 -0
- data/LICENSE +1 -1
- data/README.md +17 -2
- data/lib/jinx/json/collection.rb +7 -4
- data/lib/jinx/json/deserializable.rb +1 -1
- data/lib/jinx/json/deserializer.rb +1 -1
- data/lib/jinx/json/serializable.rb +1 -1
- data/lib/jinx/json/version.rb +1 -1
- metadata +2 -3
- data/lib/jinx/json/set.rb +0 -0
data/Gemfile
CHANGED
data/History.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
This history lists major release themes. See the GitHub commits (https://github.com/jinx/json)
|
2
2
|
for change details.
|
3
3
|
|
4
|
+
2.1.4 / 2012-11-01
|
5
|
+
------------------
|
6
|
+
* Only serialize Java attributes.
|
7
|
+
|
8
|
+
2.1.3 / 2012-06-16
|
9
|
+
------------------
|
10
|
+
* Disable lazy loader.
|
11
|
+
|
4
12
|
2.1.2 / 2012-06-12
|
5
13
|
------------------
|
6
14
|
* Support caSmall web service.
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
Jinx JSON plug-in
|
2
2
|
=================
|
3
|
-
|
4
3
|
**Home**: [http://github.com/jinx/json](http://github.com/jinx/json)
|
5
4
|
**Git**: [http://github.com/jinx/json](http://github.com/jinx/json)
|
6
5
|
**Author**: OHSU Knight Cancer Institute
|
@@ -24,8 +23,24 @@ Enable Jinx for a Java package, as described in the [Jinx](http://github.com/jin
|
|
24
23
|
require 'jinx/json'
|
25
24
|
jsoned = jinxed.to_json #=> the JSON representation of a jinxed resource
|
26
25
|
JSON[jsoned] #=> the deserialized jinxed resource
|
26
|
+
JSON
|
27
|
+
|
28
|
+
The JSON payload consists of the following:
|
29
|
+
|
30
|
+
* The standard primitive Java properties, e.g. [caTissue](http://github.com/caruby/tissue)
|
31
|
+
<tt>SpecimenCollectionGroup.surgicalPathologyNumber</tt>. If there is a Java <tt>id</tt> property,
|
32
|
+
then designate that property with <tt>identifier</tt>, since <tt>id</tt> is a reserved Ruby
|
33
|
+
method.
|
34
|
+
|
35
|
+
* An object identifier property <tt>object_id</tt> which uniquely identifies the object in the scope
|
36
|
+
of the JSON object graph.
|
37
|
+
|
38
|
+
* The standard Jinx <tt>Resource<tt/> reference properties, e.g. caTissue
|
39
|
+
<tt>TissueSpecimen.specimenCollectionGroup</tt>. If the referenced object content contains the
|
40
|
+
<tt>object_id</tt> property, then the reference resolves to the object defined in the JSON
|
41
|
+
object graph with that <tt>object_id</tt> value.
|
27
42
|
|
28
43
|
Copyright
|
29
44
|
---------
|
30
|
-
Jinx ©
|
45
|
+
Jinx © 2012 by [Oregon Health & Science University](http://www.ohsu.edu/xd/health/services/cancer).
|
31
46
|
Jinx is licensed under the MIT license. Please see the LICENSE and LEGAL files for more information.
|
data/lib/jinx/json/collection.rb
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
require 'jinx/helpers/collection'
|
2
|
+
require 'jinx/json/state'
|
2
3
|
|
3
4
|
module Jinx
|
4
5
|
module Collection
|
5
6
|
# Adds JSON serialization to collections.
|
6
7
|
#
|
7
|
-
# @param
|
8
|
-
# @return [String] the JSON representation of this
|
9
|
-
def to_json(
|
10
|
-
|
8
|
+
# @param [State, Hash, nil] state the JSON state or serialization options
|
9
|
+
# @return [String] the JSON representation of this {Jinx::Resource}
|
10
|
+
def to_json(state=nil)
|
11
|
+
# Make a new State from the options if this is a top-level call.
|
12
|
+
state = JSON::State.for(state) unless JSON::State === state
|
13
|
+
to_a.to_json(state)
|
11
14
|
end
|
12
15
|
end
|
13
16
|
end
|
data/lib/jinx/json/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: jinx-json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.1.
|
5
|
+
version: 2.1.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- OHSU
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-11-01 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -91,7 +91,6 @@ files:
|
|
91
91
|
- lib/jinx/json/deserializable.rb
|
92
92
|
- lib/jinx/json/deserializer.rb
|
93
93
|
- lib/jinx/json/serializable.rb
|
94
|
-
- lib/jinx/json/set.rb
|
95
94
|
- lib/jinx/json/state.rb
|
96
95
|
- lib/jinx/json/version.rb
|
97
96
|
- spec/serializer_spec.rb
|
data/lib/jinx/json/set.rb
DELETED
File without changes
|