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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTA4ZWUzZGQwNzA1NTE4NzgxOTc3YmM3NzlkZGNhOTY4Yzc1MzljMA==
4
+ ZGM2ZmI4ODc5NjU4OTk3NmE0MDQxN2M3NDJlY2IyZjc5MjNmYzBjNg==
5
5
  data.tar.gz: !binary |-
6
- OWE2NThlMjk0YzNlZDBmNGNmYjVhNGQ2MWE0OGQ4MWEwZDRmYTZlMw==
6
+ YzliZjY4NDYyNGI0YjFlNzQ0NTE1OTBlMDM5YzQ4NmVkOTI5M2VhZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTBiNTBkZWNhOWI1ODk1OGJhNTQ2ODlhOGQwZGRlYzhiNGE0YmZhN2QyMzBi
10
- MTY4ZWI1MTJlODU5ZmZhYzYzMDRhMGI5ZDI2Mjg5OGQ2Y2IwMDk0MDRhYTgw
11
- NmUyZTZhOTAzMmExMTJjNGJhMDFkM2ExNGI5OTc5OGE0YWIxMjI=
9
+ ZTkyOTIzNmE5Y2U1MWIyOTE4YTJmMGFjODczY2ZiMDZiMTUxYjQ3MTdiYTY1
10
+ YzVmZDgzZjkzNGYzZmVjY2E1ZWY0YTYzYjZkYjU1NDE3NDUxZmNiOWZiMzA2
11
+ YTc0YmNkZGFkZTllYmViNTBiNzk5YTRmOTYyYzRiMDFlZGEyNzg=
12
12
  data.tar.gz: !binary |-
13
- NGVmMmM4ZmFiNWUxOWJjNjZjMGRlZTc2OTcwOTJkMmIxYWI1MzJiMzI0NmQ1
14
- NWQyODViNDYyNDgyZWZlODdjY2VmZjE3MzI1MjEzMThiNzMyMzgzYzBhNDJi
15
- NjFkZjNmN2FmNWEwYmQ0MjNhYWYwOWY5ZTJhNjUxZGJjNzU2Zjk=
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.json_create( json )
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.json_create( json )
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.json_create( json )
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.json_create( json )
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.json_create( json )
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.json_create( json )
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 |
@@ -7,7 +7,7 @@ module SonJay
7
7
 
8
8
  module ClassBehavior
9
9
 
10
- def json_create(json)
10
+ def parse_json(json)
11
11
  data = JSON.parse( json )
12
12
  instance = new
13
13
  instance.sonj_content.load_data data
@@ -1,3 +1,3 @@
1
1
  module SonJay
2
- VERSION = "0.1.1.alpha"
2
+ VERSION = "0.2.0.alpha"
3
3
  end
@@ -21,9 +21,9 @@ describe SonJay::ActsAsModel do
21
21
  end
22
22
  }
23
23
 
24
- describe '::json_create' do
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.json_create( '{"hello": "world"}' )
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
@@ -55,7 +55,7 @@ describe SonJay::ObjectModel do
55
55
  expect( actual_data ).to eq( expected_data )
56
56
  end
57
57
 
58
- describe '::json_create' do
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.json_create( json )
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.1.1.alpha
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-13 00:00:00.000000000 Z
11
+ date: 2014-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler