restpack_serializer 0.4.21 → 0.4.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66c041c8e880e66f0cfa90142ae29f00922577b7
4
- data.tar.gz: 1dfb43269adb51a879921ee9308bf0777e79871e
3
+ metadata.gz: f76c6b497f02bcde9846f0e3da142d1169ea65b5
4
+ data.tar.gz: ad51fd23f32c3cefb7412a4db8724b201b1245b3
5
5
  SHA512:
6
- metadata.gz: e54f4550fbccbcd794bd0d39dd39e91f24e5d5e7a7c6b53d9d8c2663c4c622ad36d5542ab58dec8a1a325d3375b8af83007a03040be6e4ded960e1fdd90a6639
7
- data.tar.gz: fcb8afcbe8e881c49595abefeec0db97b4549d89f6b9bb5d8661284437f773e2ccdb7f6dde93c011d06aa6245d59ee4a348ac446ec34aeee53bdf4003952d2d0
6
+ metadata.gz: e4c57f561b1372a916b133a19ab0fa9645573de94b021d325a96d38b472de19183cf71ace059d87a85b4d2ca22d270aca49f89c2f03f1a04eadd67826efdbe4c
7
+ data.tar.gz: fd769e1001f4fcd7be516dc54e36069a3e20359010eab2e530aede6797addbbf18913b78f09ca9fe85abc69df4c2867c88755354eeadaaa00f38c555740218ce
@@ -28,6 +28,10 @@ module RestPack
28
28
 
29
29
  class InvalidInclude < Exception; end
30
30
 
31
+ def array_as_json(models, context = {})
32
+ as_json(models, context)
33
+ end
34
+
31
35
  def as_json(model, context = {})
32
36
  return if model.nil?
33
37
  if model.kind_of?(Array)
@@ -1,5 +1,5 @@
1
1
  module RestPack
2
2
  module Serializer
3
- VERSION = '0.4.21'
3
+ VERSION = '0.4.23'
4
4
  end
5
5
  end
@@ -83,6 +83,20 @@ describe RestPack::Serializer do
83
83
  }
84
84
  ]
85
85
  end
86
+ context ".array_as_json" do
87
+ it "results in a serialized array" do
88
+ serializer.array_as_json(people).should == [
89
+ {
90
+ id: '123', name: 'Gavin', description: 'This is person #123',
91
+ href: '/people/123', custom_key: 'custom value for model id 123'
92
+ },
93
+ {
94
+ id: '123', name: 'Gavin', description: 'This is person #123',
95
+ href: '/people/123', custom_key: 'custom value for model id 123'
96
+ }
97
+ ]
98
+ end
99
+ end
86
100
  end
87
101
 
88
102
  context "nil" do
metadata CHANGED
@@ -1,221 +1,221 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restpack_serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.21
4
+ version: 0.4.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Joyce
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-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.0.3
20
- - - <
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 4.0.3
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activerecord
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - '>='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: 4.0.3
40
- - - <
40
+ - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '5.0'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: 4.0.3
50
- - - <
50
+ - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '5.0'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: protected_attributes
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ~>
57
+ - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: 1.0.5
60
60
  type: :runtime
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - ~>
64
+ - - "~>"
65
65
  - !ruby/object:Gem::Version
66
66
  version: 1.0.5
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: kaminari
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ~>
71
+ - - "~>"
72
72
  - !ruby/object:Gem::Version
73
73
  version: 0.15.1
74
74
  type: :runtime
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ~>
78
+ - - "~>"
79
79
  - !ruby/object:Gem::Version
80
80
  version: 0.15.1
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: restpack_gem
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - ~>
85
+ - - "~>"
86
86
  - !ruby/object:Gem::Version
87
87
  version: 0.0.9
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - ~>
92
+ - - "~>"
93
93
  - !ruby/object:Gem::Version
94
94
  version: 0.0.9
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: rake
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - ~>
99
+ - - "~>"
100
100
  - !ruby/object:Gem::Version
101
101
  version: 10.0.3
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ~>
106
+ - - "~>"
107
107
  - !ruby/object:Gem::Version
108
108
  version: 10.0.3
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: rspec
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
- - - ~>
113
+ - - "~>"
114
114
  - !ruby/object:Gem::Version
115
115
  version: '2.12'
116
116
  type: :development
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - ~>
120
+ - - "~>"
121
121
  - !ruby/object:Gem::Version
122
122
  version: '2.12'
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: guard-rspec
125
125
  requirement: !ruby/object:Gem::Requirement
126
126
  requirements:
127
- - - ~>
127
+ - - "~>"
128
128
  - !ruby/object:Gem::Version
129
129
  version: 2.5.4
130
130
  type: :development
131
131
  prerelease: false
132
132
  version_requirements: !ruby/object:Gem::Requirement
133
133
  requirements:
134
- - - ~>
134
+ - - "~>"
135
135
  - !ruby/object:Gem::Version
136
136
  version: 2.5.4
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: growl
139
139
  requirement: !ruby/object:Gem::Requirement
140
140
  requirements:
141
- - - ~>
141
+ - - "~>"
142
142
  - !ruby/object:Gem::Version
143
143
  version: 1.0.3
144
144
  type: :development
145
145
  prerelease: false
146
146
  version_requirements: !ruby/object:Gem::Requirement
147
147
  requirements:
148
- - - ~>
148
+ - - "~>"
149
149
  - !ruby/object:Gem::Version
150
150
  version: 1.0.3
151
151
  - !ruby/object:Gem::Dependency
152
152
  name: factory_girl
153
153
  requirement: !ruby/object:Gem::Requirement
154
154
  requirements:
155
- - - ~>
155
+ - - "~>"
156
156
  - !ruby/object:Gem::Version
157
157
  version: 4.2.0
158
158
  type: :development
159
159
  prerelease: false
160
160
  version_requirements: !ruby/object:Gem::Requirement
161
161
  requirements:
162
- - - ~>
162
+ - - "~>"
163
163
  - !ruby/object:Gem::Version
164
164
  version: 4.2.0
165
165
  - !ruby/object:Gem::Dependency
166
166
  name: sqlite3
167
167
  requirement: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - ~>
169
+ - - "~>"
170
170
  - !ruby/object:Gem::Version
171
171
  version: 1.3.7
172
172
  type: :development
173
173
  prerelease: false
174
174
  version_requirements: !ruby/object:Gem::Requirement
175
175
  requirements:
176
- - - ~>
176
+ - - "~>"
177
177
  - !ruby/object:Gem::Version
178
178
  version: 1.3.7
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: database_cleaner
181
181
  requirement: !ruby/object:Gem::Requirement
182
182
  requirements:
183
- - - ~>
183
+ - - "~>"
184
184
  - !ruby/object:Gem::Version
185
185
  version: 1.0.1
186
186
  type: :development
187
187
  prerelease: false
188
188
  version_requirements: !ruby/object:Gem::Requirement
189
189
  requirements:
190
- - - ~>
190
+ - - "~>"
191
191
  - !ruby/object:Gem::Version
192
192
  version: 1.0.1
193
193
  - !ruby/object:Gem::Dependency
194
194
  name: rspec
195
195
  requirement: !ruby/object:Gem::Requirement
196
196
  requirements:
197
- - - '>='
197
+ - - ">="
198
198
  - !ruby/object:Gem::Version
199
199
  version: '0'
200
200
  type: :development
201
201
  prerelease: false
202
202
  version_requirements: !ruby/object:Gem::Requirement
203
203
  requirements:
204
- - - '>='
204
+ - - ">="
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  - !ruby/object:Gem::Dependency
208
208
  name: bump
209
209
  requirement: !ruby/object:Gem::Requirement
210
210
  requirements:
211
- - - '>='
211
+ - - ">="
212
212
  - !ruby/object:Gem::Version
213
213
  version: '0'
214
214
  type: :development
215
215
  prerelease: false
216
216
  version_requirements: !ruby/object:Gem::Requirement
217
217
  requirements:
218
- - - '>='
218
+ - - ">="
219
219
  - !ruby/object:Gem::Version
220
220
  version: '0'
221
221
  description: Model serialization, paging, side-loading and filtering
@@ -225,9 +225,9 @@ executables: []
225
225
  extensions: []
226
226
  extra_rdoc_files: []
227
227
  files:
228
- - .gitignore
229
- - .rspec
230
- - .travis.yml
228
+ - ".gitignore"
229
+ - ".rspec"
230
+ - ".travis.yml"
231
231
  - Gemfile
232
232
  - Guardfile
233
233
  - LICENSE
@@ -273,17 +273,17 @@ require_paths:
273
273
  - lib
274
274
  required_ruby_version: !ruby/object:Gem::Requirement
275
275
  requirements:
276
- - - '>='
276
+ - - ">="
277
277
  - !ruby/object:Gem::Version
278
278
  version: '0'
279
279
  required_rubygems_version: !ruby/object:Gem::Requirement
280
280
  requirements:
281
- - - '>='
281
+ - - ">="
282
282
  - !ruby/object:Gem::Version
283
283
  version: '0'
284
284
  requirements: []
285
285
  rubyforge_project:
286
- rubygems_version: 2.0.5
286
+ rubygems_version: 2.0.14
287
287
  signing_key:
288
288
  specification_version: 4
289
289
  summary: Model serialization, paging, side-loading and filtering
@@ -305,3 +305,4 @@ test_files:
305
305
  - spec/serializable/single_spec.rb
306
306
  - spec/spec_helper.rb
307
307
  - spec/support/factory.rb
308
+ has_rdoc: