easy_serializer 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -0
- data/.travis.yml +2 -0
- data/lib/easy_serializer/cacher/collection.rb +2 -2
- data/lib/easy_serializer/cacher/method.rb +10 -6
- data/lib/easy_serializer/cacher/serializer.rb +6 -2
- data/lib/easy_serializer/collection.rb +4 -0
- data/lib/easy_serializer/helpers.rb +6 -0
- data/lib/easy_serializer/root_cacher.rb +8 -2
- data/lib/easy_serializer/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 51a5fce9d5fdf2ba86d18f1c54f43cb5a0094952c45ad4701e731bb17ebafabc
|
4
|
+
data.tar.gz: e71a8a20266a1e0d7fe1e0ff75acfea1fc63f77bb0d1bc671506f3143a3568e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59865f058272e4ba91a1705ded10442461d01d4579223fe7aabb96dcb3e48d1d3c17610352bf011336d7aeda597b1d71266d2e1168929ab68caddfc9bfd5ccbc
|
7
|
+
data.tar.gz: b05b744a61f759f3928a5c2ffebe58f964df33a56a7e6afffb7169ec647b5ea7b4a14dd1f242e4de17f919503b9e7226cd5dde6073c600cae0078984f694703e
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/.travis.yml
CHANGED
@@ -14,9 +14,9 @@ module EasySerializer
|
|
14
14
|
|
15
15
|
def key(elem)
|
16
16
|
if metadata_key
|
17
|
-
[elem, metadata_key, nested_serializer.name]
|
17
|
+
[cache_key(elem), metadata_key, nested_serializer.name]
|
18
18
|
else
|
19
|
-
[elem, nested_serializer.name]
|
19
|
+
[cache_key(elem), nested_serializer.name]
|
20
20
|
end.flatten
|
21
21
|
end
|
22
22
|
|
@@ -7,12 +7,16 @@ module EasySerializer
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def key
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
[
|
10
|
+
extra_cache_key = if metadata.cache_key
|
11
|
+
option_to_value(metadata.cache_key, serializer.object, serializer)
|
12
|
+
else
|
13
|
+
metadata.name
|
14
|
+
end
|
15
|
+
[cache_key, extra_cache_key, serializer.class.name].flatten
|
16
|
+
end
|
17
|
+
|
18
|
+
def subject
|
19
|
+
serializer.object
|
16
20
|
end
|
17
21
|
|
18
22
|
def options
|
@@ -8,12 +8,16 @@ module EasySerializer
|
|
8
8
|
|
9
9
|
def key
|
10
10
|
if metadata_key
|
11
|
-
[
|
11
|
+
[cache_key, metadata_key, nested_serializer.name]
|
12
12
|
else
|
13
|
-
[
|
13
|
+
[cache_key, nested_serializer.name]
|
14
14
|
end.flatten
|
15
15
|
end
|
16
16
|
|
17
|
+
def subject
|
18
|
+
value
|
19
|
+
end
|
20
|
+
|
17
21
|
def options
|
18
22
|
metadata.cache_options || {}
|
19
23
|
end
|
@@ -19,6 +19,12 @@ module EasySerializer
|
|
19
19
|
def object
|
20
20
|
serializer.object
|
21
21
|
end
|
22
|
+
alias_method :subject, :object
|
23
|
+
|
24
|
+
def cache_key
|
25
|
+
return object.cache_key if object.respond_to?(:cache_key)
|
26
|
+
object
|
27
|
+
end
|
22
28
|
|
23
29
|
def options
|
24
30
|
h = serializer.__cache.dup
|
@@ -32,9 +38,9 @@ module EasySerializer
|
|
32
38
|
custom_key = serializer.__cache[:key]
|
33
39
|
if custom_key
|
34
40
|
k = option_to_value(custom_key, object, serializer)
|
35
|
-
[
|
41
|
+
[cache_key, k, serializer.class.name]
|
36
42
|
else
|
37
|
-
[
|
43
|
+
[cache_key, serializer.class.name]
|
38
44
|
end.flatten
|
39
45
|
end
|
40
46
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artur Pañach
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- ".coveralls.yml"
|
66
66
|
- ".gitignore"
|
67
67
|
- ".rspec"
|
68
|
+
- ".ruby-version"
|
68
69
|
- ".travis.yml"
|
69
70
|
- CODE_OF_CONDUCT.md
|
70
71
|
- Gemfile
|
@@ -109,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
110
|
version: '0'
|
110
111
|
requirements: []
|
111
112
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.7.6
|
113
114
|
signing_key:
|
114
115
|
specification_version: 4
|
115
116
|
summary: Semantic serializer for making easy serializing objects.
|