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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/jsonapi-object-mapper/deserialize/collection.rb +4 -4
- data/lib/jsonapi-object-mapper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18d652668943a4762ffbb6cc6743f79a2b29e556252f82d9145c946b76b86139
|
4
|
+
data.tar.gz: a64f7b02809d7923901670ec0f86ca9e6ed3cf99607f23cb6289a704dc928ff9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 714ce517630817305cb72738d2482018957267d6e8485758f2fbb5edb276b2e75588987e8df081166b35b53f430081f59c14d0ff618e3828d2c94afad09bae2f
|
7
|
+
data.tar.gz: a6f9c284e5772ae2e81b2ad129e03dd89934da1a6973e8f569d11498ceee7272a62166606f0b80b785535a0061557770248d05b76fd364c51265cd60c0fe3d9c
|
data/Gemfile.lock
CHANGED
@@ -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
|