light_serializer 0.0.8 → 0.0.9

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
  SHA256:
3
- metadata.gz: e19a7ae11ca3bfee4350cad7874ba08e2f07a01031886c51585dda15538b9963
4
- data.tar.gz: 38e370df48a4f0ec77b627038320f045425a761c2dceb3021a032eadd387a402
3
+ metadata.gz: 1b6d67d6f9e6d029842817c86b63aedfc03b6e42f6f51d5fed49cced1b0f5de3
4
+ data.tar.gz: 95681b5c15a5d8e82f9a896903e4752bcc081bfbc2289857095da0f638085f84
5
5
  SHA512:
6
- metadata.gz: 172a24e89701dbb0d0784ef48aed9e3565f11184abdf8f70bfa0a0bbdf605df822593bf7da179995988159fb42d53ba3ae431c0deea071add5b675edfd843962
7
- data.tar.gz: f5c0dc2b82b75a95a547061d59e3682eb96828704a252a1f844c25b5ca3a29cc12de99f7e63621bef67e2d04fb91b2bf81c622cc85bbd54505193036bfd3c0a9
6
+ metadata.gz: 971d749ecb3b1d9ef7561d9ac84907090e7ed9218ee6d07d27a3af7f0fb0e3543c1485d0559268a6225217673b2649eb24eff872c011ff74f6df98b56c1a5808
7
+ data.tar.gz: 8dd7ea83ec069c7a7b69e4fde2aadfa204ab431aa65829609e074f7dbc525642cc7cec1bea1b8af3032939d349bd6ec9a20e499b90d54ea570b56718c96dc384
data/Gemfile.lock CHANGED
@@ -1,17 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- light_serializer (0.0.8)
4
+ light_serializer (0.0.9)
5
5
  oj (~> 3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (4.2.10)
11
- i18n (~> 0.7)
12
- minitest (~> 5.1)
13
- thread_safe (~> 0.3, >= 0.3.4)
14
- tzinfo (~> 1.1)
15
10
  ast (2.4.0)
16
11
  axiom-types (0.1.1)
17
12
  descendants_tracker (~> 0.0.4)
@@ -23,21 +18,15 @@ GEM
23
18
  coderay (1.1.2)
24
19
  coercible (1.0.0)
25
20
  descendants_tracker (~> 0.0.1)
26
- concurrent-ruby (1.0.5)
27
21
  descendants_tracker (0.0.4)
28
22
  thread_safe (~> 0.3, >= 0.3.1)
29
23
  diff-lcs (1.3)
30
24
  equalizer (0.0.11)
31
- factory_bot (4.11.1)
32
- activesupport (>= 3.0.0)
33
- i18n (0.9.5)
34
- concurrent-ruby (~> 1.0)
35
25
  ice_nine (0.11.2)
36
26
  jaro_winkler (1.5.1)
37
27
  kwalify (0.7.2)
38
28
  method_source (0.9.0)
39
- minitest (5.11.3)
40
- oj (3.7.4)
29
+ oj (3.7.6)
41
30
  parallel (1.12.1)
42
31
  parser (2.5.3.0)
43
32
  ast (~> 2.4.0)
@@ -80,8 +69,6 @@ GEM
80
69
  rubocop (>= 0.58.0)
81
70
  ruby-progressbar (1.10.0)
82
71
  thread_safe (0.3.6)
83
- tzinfo (1.2.5)
84
- thread_safe (~> 0.1)
85
72
  unicode-display_width (1.4.0)
86
73
  virtus (1.0.5)
87
74
  axiom-types (~> 0.1)
@@ -94,7 +81,6 @@ PLATFORMS
94
81
 
95
82
  DEPENDENCIES
96
83
  bundler (~> 1.0)
97
- factory_bot (~> 4.11)
98
84
  light_serializer!
99
85
  pry-byebug (~> 3.0)
100
86
  rake (~> 10.0)
@@ -104,4 +90,4 @@ DEPENDENCIES
104
90
  rubocop-rspec (~> 1.30)
105
91
 
106
92
  BUNDLED WITH
107
- 1.16.2
93
+ 1.17.3
@@ -35,12 +35,11 @@ module LightSerializer
35
35
  end
36
36
  end
37
37
 
38
- def values_from_nested_resource(attribute, object, result)
39
- attribute_name = attribute.keys[-1]
40
- nested_serializer = attribute.values[-1]
41
-
42
- value = obtain_value(object, attribute_name)
43
- result[attribute_name] = hashed_nested_resource(value, nested_serializer)
38
+ def values_from_nested_resource(attributes, object, result)
39
+ attributes.each do |attribute_name, nested_serializer|
40
+ value = obtain_value(object, attribute_name)
41
+ result[attribute_name] = hashed_nested_resource(value, nested_serializer)
42
+ end
44
43
  end
45
44
 
46
45
  def hashed_nested_resource(value, nested_serializer)
@@ -6,7 +6,7 @@ module LightSerializer
6
6
  attr_reader :object, :root, :context, :meta
7
7
 
8
8
  def self.attributes(*new_attributes)
9
- return @attributes if new_attributes.empty?
9
+ return (@attributes || []) if new_attributes.empty?
10
10
 
11
11
  @attributes = @attributes ? @attributes.concat(new_attributes) : new_attributes
12
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LightSerializer
4
- VERSION = '0.0.8'
4
+ VERSION = '0.0.9'
5
5
  end
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.required_ruby_version = '>= 2.3'
23
23
  spec.add_dependency 'oj', '~> 3'
24
24
  spec.add_development_dependency 'bundler', '~> 1.0'
25
- spec.add_development_dependency 'factory_bot', '~> 4.11'
26
25
  spec.add_development_dependency 'pry-byebug', '~> 3.0'
27
26
  spec.add_development_dependency 'rake', '~> 10.0'
28
27
  spec.add_development_dependency 'reek', '~> 5.1'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: light_serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Rodionov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-12-01 00:00:00.000000000 Z
12
+ date: 2019-01-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oj
@@ -39,20 +39,6 @@ dependencies:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.0'
42
- - !ruby/object:Gem::Dependency
43
- name: factory_bot
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '4.11'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - "~>"
54
- - !ruby/object:Gem::Version
55
- version: '4.11'
56
42
  - !ruby/object:Gem::Dependency
57
43
  name: pry-byebug
58
44
  requirement: !ruby/object:Gem::Requirement
@@ -182,8 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
168
  - !ruby/object:Gem::Version
183
169
  version: '0'
184
170
  requirements: []
185
- rubyforge_project:
186
- rubygems_version: 2.7.6
171
+ rubygems_version: 3.0.1
187
172
  signing_key:
188
173
  specification_version: 4
189
174
  summary: Light and Fast Serializer