restpack_serializer 0.4.23 → 0.4.24

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f76c6b497f02bcde9846f0e3da142d1169ea65b5
4
- data.tar.gz: ad51fd23f32c3cefb7412a4db8724b201b1245b3
3
+ metadata.gz: f41191ba4961b7f1ce4651b4fd1f510b9e784ff9
4
+ data.tar.gz: b07c073cbccfa5964092ad108350f25aea0d1e26
5
5
  SHA512:
6
- metadata.gz: e4c57f561b1372a916b133a19ab0fa9645573de94b021d325a96d38b472de19183cf71ace059d87a85b4d2ca22d270aca49f89c2f03f1a04eadd67826efdbe4c
7
- data.tar.gz: fd769e1001f4fcd7be516dc54e36069a3e20359010eab2e530aede6797addbbf18913b78f09ca9fe85abc69df4c2867c88755354eeadaaa00f38c555740218ce
6
+ metadata.gz: f7c256addcf1c9212a02f2aeab7aca61a0f66b2e5ad0bd1ad9e5acebc59397359be5825d86dca3915ee087985f135a9d2bc5153889eb1496555468eb2f08b494
7
+ data.tar.gz: 2435d8486616017591fb7f6041e39e6f66c69f06645822252da5eddd87b24c48cef73eb7118913c4761891be414de20dbb797914b8a2c4db69847e5e7da2e592
@@ -28,10 +28,6 @@ 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
-
35
31
  def as_json(model, context = {})
36
32
  return if model.nil?
37
33
  if model.kind_of?(Array)
@@ -84,6 +80,10 @@ module RestPack
84
80
  module ClassMethods
85
81
  attr_accessor :model_class, :key
86
82
 
83
+ def array_as_json(models, context = {})
84
+ new.as_json(models, context)
85
+ end
86
+
87
87
  def as_json(model, context = {})
88
88
  new.as_json(model, context)
89
89
  end
@@ -1,5 +1,5 @@
1
1
  module RestPack
2
2
  module Serializer
3
- VERSION = '0.4.23'
3
+ VERSION = '0.4.24'
4
4
  end
5
5
  end
@@ -83,9 +83,9 @@ describe RestPack::Serializer do
83
83
  }
84
84
  ]
85
85
  end
86
- context ".array_as_json" do
86
+ context "#array_as_json" do
87
87
  it "results in a serialized array" do
88
- serializer.array_as_json(people).should == [
88
+ serializer.class.array_as_json(people).should == [
89
89
  {
90
90
  id: '123', name: 'Gavin', description: 'This is person #123',
91
91
  href: '/people/123', custom_key: 'custom value for model id 123'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restpack_serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.23
4
+ version: 0.4.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Joyce