son_jay 0.1.1.alpha → 0.2.0.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/features/json_parsing.feature +6 -6
- data/lib/son_jay/acts_as_model.rb +1 -1
- data/lib/son_jay/version.rb +1 -1
- data/spec/acts_as_model_spec.rb +2 -2
- data/spec/object_model_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGM2ZmI4ODc5NjU4OTk3NmE0MDQxN2M3NDJlY2IyZjc5MjNmYzBjNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzliZjY4NDYyNGI0YjFlNzQ0NTE1OTBlMDM5YzQ4NmVkOTI5M2VhZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTkyOTIzNmE5Y2U1MWIyOTE4YTJmMGFjODczY2ZiMDZiMTUxYjQ3MTdiYTY1
|
10
|
+
YzVmZDgzZjkzNGYzZmVjY2E1ZWY0YTYzYjZkYjU1NDE3NDUxZmNiOWZiMzA2
|
11
|
+
YTc0YmNkZGFkZTllYmViNTBiNzk5YTRmOTYyYzRiMDFlZGEyNzg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTM2OGM2OTY1MDI4YWY5YzZiODc4Y2FhZTAyZTA2N2M2NzgyNjU2MzQ5MTIy
|
14
|
+
M2M5NGVjNzAwNDQ0ZGIxMmExN2QzYWFiMjAzYzdlNTViMjRhYTI3MTg4ZWFl
|
15
|
+
YmVjOTM0Nzc2NjdmZjE4NGZjMDkwZWM4OTc5MzdiOGIyYTkwNzY=
|
@@ -27,7 +27,7 @@ Feature: Parsing data from JSON
|
|
27
27
|
"""
|
28
28
|
When the JSON is parsed to a model instance as:
|
29
29
|
"""
|
30
|
-
instance = SimpleObjectModel.
|
30
|
+
instance = SimpleObjectModel.parse_json( json )
|
31
31
|
"""
|
32
32
|
Then the instance attributes are as follows:
|
33
33
|
| id | name | published | featured | owner |
|
@@ -67,7 +67,7 @@ Feature: Parsing data from JSON
|
|
67
67
|
"""
|
68
68
|
When the JSON is parsed to a model instance as:
|
69
69
|
"""
|
70
|
-
instance = ThingModel.
|
70
|
+
instance = ThingModel.parse_json( json )
|
71
71
|
"""
|
72
72
|
Then the instance attributes are as follows:
|
73
73
|
| name | details.color | details.size |
|
@@ -94,7 +94,7 @@ Feature: Parsing data from JSON
|
|
94
94
|
"""
|
95
95
|
When the JSON is parsed to a model instance as:
|
96
96
|
"""
|
97
|
-
instance = ContestantModel.
|
97
|
+
instance = ContestantModel.parse_json( json )
|
98
98
|
"""
|
99
99
|
Then the instance attributes are as follows:
|
100
100
|
| name | scores[0] | scores[1] | scores[2] |
|
@@ -127,7 +127,7 @@ Feature: Parsing data from JSON
|
|
127
127
|
"""
|
128
128
|
When the JSON is parsed to a model instance as:
|
129
129
|
"""
|
130
|
-
instance = TicTacToeModel.
|
130
|
+
instance = TicTacToeModel.parse_json( json )
|
131
131
|
"""
|
132
132
|
Then the instance attributes are as follows:
|
133
133
|
| rows[0][0] | rows[0][1] | rows[0][2] |
|
@@ -177,7 +177,7 @@ Feature: Parsing data from JSON
|
|
177
177
|
"""
|
178
178
|
When the JSON is parsed to a model instance as:
|
179
179
|
"""
|
180
|
-
instance = ListModel.
|
180
|
+
instance = ListModel.parse_json( json )
|
181
181
|
"""
|
182
182
|
Then the instance attributes are as follows:
|
183
183
|
| name | items[0].description | items[0].priority | items[1].description | items[1].priority |
|
@@ -216,7 +216,7 @@ Feature: Parsing data from JSON
|
|
216
216
|
"""
|
217
217
|
When the JSON is parsed to a model instance as:
|
218
218
|
"""
|
219
|
-
instance = TableModel.
|
219
|
+
instance = TableModel.parse_json( json )
|
220
220
|
"""
|
221
221
|
Then the instance attributes are as follows:
|
222
222
|
| rows[0][0].is_head | rows[0][0].value | rows[0][1].is_head | rows[0][1].value |
|
data/lib/son_jay/version.rb
CHANGED
data/spec/acts_as_model_spec.rb
CHANGED
@@ -21,9 +21,9 @@ describe SonJay::ActsAsModel do
|
|
21
21
|
end
|
22
22
|
}
|
23
23
|
|
24
|
-
describe '::
|
24
|
+
describe '::parse_json' do
|
25
25
|
it "returns a new instance with parsed JSON data loaded into its #sonj_content object" do
|
26
|
-
instance = klass.
|
26
|
+
instance = klass.parse_json( '{"hello": "world"}' )
|
27
27
|
loaded_data = instance.sonj_content.loaded_data
|
28
28
|
expect( loaded_data ).to eq( {'hello' => 'world'} )
|
29
29
|
end
|
data/spec/object_model_spec.rb
CHANGED
@@ -55,7 +55,7 @@ describe SonJay::ObjectModel do
|
|
55
55
|
expect( actual_data ).to eq( expected_data )
|
56
56
|
end
|
57
57
|
|
58
|
-
describe '::
|
58
|
+
describe '::parse_json' do
|
59
59
|
it "creates an instance with properties filled in from parsed JSON" do
|
60
60
|
json = <<-JSON
|
61
61
|
{
|
@@ -64,7 +64,7 @@ describe SonJay::ObjectModel do
|
|
64
64
|
}
|
65
65
|
JSON
|
66
66
|
|
67
|
-
instance = subclass.
|
67
|
+
instance = subclass.parse_json( json )
|
68
68
|
|
69
69
|
expect( instance.abc ).to eq( 123 )
|
70
70
|
expect( instance.xyz ).to eq( 'XYZ' )
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: son_jay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Jorgensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|