seri 0.1.4 → 0.1.5

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: 46c74db605b3be850012902824a5e6eb8cea24840283a19c2a693b8494ab4c05
4
- data.tar.gz: 1a5c0e021e369f0a8426a8e9295965a7c9c8e00da1b03058723c1846d9ae9a82
3
+ metadata.gz: 3a080e5eb873ba467789a339f0ceefa26e8f86b9c88f92d11f55b97a5bba86d0
4
+ data.tar.gz: 30b4ef48887b9a4083c64623f46294079078add3176ef45ee92a9dfbe98e4f66
5
5
  SHA512:
6
- metadata.gz: 7b13a08781a36ed66bc7a2dc0407408a112e183c20177ef00a01509470c25e0e8bf164758e86405cd9be2828bcddd554fbfc1975f1390b774350bd1cb074e70c
7
- data.tar.gz: '08ced2f63fcb804cba013f214284928f15a9f5ad4afbe7fd5002b4b08643908fc2bd8adcc64edf5a48831110ae313e51519cfad12a79fe589bad0e4db0d13580'
6
+ metadata.gz: 5e8fe5badf7bfc337d91e02540a1df44f66de49786e9b8c1da6cfd59b631f613bdf9e3aba61ad972d366716dfe32c21b527bc4b67373d3cd59a61e672952e226
7
+ data.tar.gz: 65d6c70dfea3489728816beffd1c4febbabf2076607f06daa55991a4f1ac9cfbd5526ac6fab32bd2b78d5a89f534b9e844f8e3a53f2f69a6692fa3ebf95b106e
@@ -1,3 +1,3 @@
1
1
  class Serializer
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
data/lib/serializer.rb CHANGED
@@ -42,18 +42,14 @@ class Serializer
42
42
  value = if attribute.options.has_key?(:static_value)
43
43
  attribute.options.fetch(:static_value)
44
44
  elsif respond_to?(extraction_key)
45
- value = public_send(extraction_key)
46
-
47
- serialize_value(value, attribute.serializer)
45
+ public_send(extraction_key)
48
46
  elsif object.respond_to?(extraction_key)
49
- value = object.public_send(extraction_key)
50
-
51
- serialize_value(value, attribute.serializer)
47
+ object.public_send(extraction_key)
52
48
  else
53
49
  raise SerializerError, "unknown attribute '#{extraction_key}'"
54
50
  end
55
51
 
56
- obj[attribute.key] = value
52
+ obj[attribute.key] = serialize_value(value, attribute.serializer)
57
53
  end
58
54
  end
59
55
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seri
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - grdw