jsonapi-object-mapper 0.7.0 → 0.7.5

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
  SHA256:
3
- metadata.gz: c55b670a2ffe1d7d8d64a77103e3652694ad29076072cda48899f65228fb8232
4
- data.tar.gz: 5e597a8fe9650ef363ce6bf6902d3b5de7b3b316a49b50107e57018191c93e57
3
+ metadata.gz: 18d652668943a4762ffbb6cc6743f79a2b29e556252f82d9145c946b76b86139
4
+ data.tar.gz: a64f7b02809d7923901670ec0f86ca9e6ed3cf99607f23cb6289a704dc928ff9
5
5
  SHA512:
6
- metadata.gz: 7b037952245ea17ff6baed1cde1fe3d17620c29d268be9df0230ece3d48f51ac1b92ca9d99b9f21ae563a3e1e5d6cde23825e8b9a7294d21f8844bc7fb3ddad6
7
- data.tar.gz: 187087f89ba2fd1d2fa18faaca2ea9f2f2312875466b24fe4593ff933d964ccd36b5eefdb8e114f60b3afe04636730cb2f7642ec62845936cc950189ccf7a2ab
6
+ metadata.gz: 714ce517630817305cb72738d2482018957267d6e8485758f2fbb5edb276b2e75588987e8df081166b35b53f430081f59c14d0ff618e3828d2c94afad09bae2f
7
+ data.tar.gz: a6f9c284e5772ae2e81b2ad129e03dd89934da1a6973e8f569d11498ceee7272a62166606f0b80b785535a0061557770248d05b76fd364c51265cd60c0fe3d9c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jsonapi-object-mapper (0.7.0)
4
+ jsonapi-object-mapper (0.7.5)
5
5
  oj (~> 3.0)
6
6
 
7
7
  GEM
@@ -1,15 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "jsonapi-object-mapper/parser/errors"
4
+ extend Forwardable
4
5
 
5
6
  module JsonAPIObjectMapper
6
7
  module Deserialize
7
8
  class Collection
9
+ extend Forwardable
8
10
  include Enumerable
9
11
  include JsonAPIObjectMapper::Parser::Errors
10
12
 
11
13
  attr_accessor :collection_data
12
14
 
15
+ def_delegators :@collection_data, :first, :last, :[]
16
+
13
17
  def initialize(parser, klass:)
14
18
  raise InvalidResource unless klass.is_a?(Class)
15
19
  raise InvalidParser unless parser.is_a?(JsonAPIObjectMapper::Parser::Document)
@@ -30,10 +34,6 @@ module JsonAPIObjectMapper
30
34
  @collection_data.map(&:to_hash)
31
35
  end
32
36
 
33
- def [](index)
34
- @collection_data[index]
35
- end
36
-
37
37
  def each
38
38
  @collection_data.each do |data|
39
39
  yield data
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonAPIObjectMapper
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-object-mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Protacio-Karaszi