simply_serializable 1.4.2 → 1.5.0
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/.gitignore +2 -0
- data/Gemfile.lock +7 -4
- data/lib/simply_serializable/mixin.rb +16 -16
- data/lib/simply_serializable/version.rb +1 -1
- data/simply_serializable.gemspec +2 -1
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62f01e9abd2418de7e70f630c9fe9357f185918353a630eea112a4f6135dc3d5
|
4
|
+
data.tar.gz: a5f53ff65fa05b01a720e3ab64e1a06d4a4cbeca873671b8933bfda62ea0aaf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '009c25323d80cfe57569f4c0d730a9d9df350b3368facb4ac07dbb75a36d438efe04b2e72d45205e0f772d5fcca5ae103a9e17fbdd1a67665760be4d6db01ec0'
|
7
|
+
data.tar.gz: 95d210802b7bd4c85b1287aeeb8d3609c2f0823cb5e2b9a6af85677d3a8679c06459a8049ee6508c5273ab78da6a2eb4990dbe8c8d7793c9ae6099b536aed524
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
simply_serializable (1.
|
4
|
+
simply_serializable (1.5.0)
|
5
5
|
fingerprintable (>= 1.2.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -22,7 +22,9 @@ GEM
|
|
22
22
|
fingerprintable (1.2.1)
|
23
23
|
colorize
|
24
24
|
json (2.2.0)
|
25
|
-
|
25
|
+
pd_ruby (0.2.3)
|
26
|
+
colorize
|
27
|
+
rake (13.0.1)
|
26
28
|
rspec (3.8.0)
|
27
29
|
rspec-core (~> 3.8.0)
|
28
30
|
rspec-expectations (~> 3.8.0)
|
@@ -55,9 +57,10 @@ DEPENDENCIES
|
|
55
57
|
bundler (~> 2.0)
|
56
58
|
byebug
|
57
59
|
coveralls
|
58
|
-
|
60
|
+
pd_ruby
|
61
|
+
rake (~> 13.0)
|
59
62
|
rspec (~> 3.0)
|
60
63
|
simply_serializable!
|
61
64
|
|
62
65
|
BUNDLED WITH
|
63
|
-
2.
|
66
|
+
2.1.4
|
@@ -4,28 +4,28 @@ module SimplySerializable
|
|
4
4
|
module Mixin
|
5
5
|
module ClassMethods
|
6
6
|
def inherited(subclass)
|
7
|
-
subclass.
|
7
|
+
subclass.simply_serialize(**simply_serializable_config)
|
8
8
|
super(subclass)
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
12
|
-
|
11
|
+
def simply_serialize(attributes: [], except: nil, only: nil, **keywords)
|
12
|
+
simply_serializable_config[:attributes] = simply_serializable_config[:attributes] |= attributes
|
13
13
|
|
14
14
|
unless except.nil?
|
15
|
-
|
16
|
-
|
15
|
+
simply_serializable_config[:except] ||= []
|
16
|
+
simply_serializable_config[:except] = simply_serializable_config[:except] |= except
|
17
17
|
end
|
18
18
|
|
19
19
|
unless only.nil?
|
20
|
-
|
21
|
-
|
20
|
+
simply_serializable_config[:only] ||= []
|
21
|
+
simply_serializable_config[:only] = simply_serializable_config[:only] |= only
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
simply_serializable_config.merge!(keywords)
|
25
25
|
end
|
26
26
|
|
27
|
-
def
|
28
|
-
@
|
27
|
+
def simply_serializable_config
|
28
|
+
@simply_serializable_config ||= {
|
29
29
|
attributes: [],
|
30
30
|
except: nil,
|
31
31
|
only: nil
|
@@ -38,13 +38,13 @@ module SimplySerializable
|
|
38
38
|
base.extend(ClassMethods)
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
42
|
-
|
41
|
+
def simply_serialize(cache: {}, **options)
|
42
|
+
simply_serializer(cache: cache, **options).serialize
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
45
|
+
def simply_serializer(cache: {}, **options)
|
46
46
|
Serializer.new(
|
47
|
-
**self.class.
|
47
|
+
**self.class.simply_serializable_config.merge(
|
48
48
|
options
|
49
49
|
).merge(
|
50
50
|
cache: cache,
|
@@ -53,8 +53,8 @@ module SimplySerializable
|
|
53
53
|
)
|
54
54
|
end
|
55
55
|
|
56
|
-
def
|
57
|
-
|
56
|
+
def simply_serializable_id
|
57
|
+
simply_serializer.id
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
data/simply_serializable.gemspec
CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
31
31
|
spec.add_development_dependency 'byebug', '>= 0'
|
32
32
|
spec.add_development_dependency 'coveralls', '>= 0'
|
33
|
-
spec.add_development_dependency '
|
33
|
+
spec.add_development_dependency 'pd_ruby'
|
34
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
34
35
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
35
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simply_serializable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Jackson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fingerprintable
|
@@ -94,20 +94,34 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pd_ruby
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rake
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
117
|
+
version: '13.0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
124
|
+
version: '13.0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rspec
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
183
|
- !ruby/object:Gem::Version
|
170
184
|
version: '0'
|
171
185
|
requirements: []
|
172
|
-
rubygems_version: 3.0.
|
186
|
+
rubygems_version: 3.0.3
|
173
187
|
signing_key:
|
174
188
|
specification_version: 4
|
175
189
|
summary: Simply Serializable makes it easy to serialize any object.
|