ializer 0.5.0 → 0.6.0

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: 497afd4a62c4b255b976501c69adf8de2a569376c25c7aefb4a94b7ed94200bc
4
- data.tar.gz: '082946872d647c482b9044898b8e9069fec868339b33eac6f4c8996a446e47be'
3
+ metadata.gz: 65d2290293ec3f08da6cf2b4b4ce3f30c7240ace2157380f6394c578902f6057
4
+ data.tar.gz: b7c0e5883f3133c4ea215648af2133cdb8d00153dbd1b53c2a08f3518c62bac7
5
5
  SHA512:
6
- metadata.gz: 0d079821ef910ac423409b0af192fdf971236fc7cd39efb1b994f0817edebbe16285302fc14d34634f452b16af85195d8c522fd3677ad17a0c5b1a9100f1c35f
7
- data.tar.gz: b2136f4515fbfe36d270f1c726dd45417f5759ea931f0f264a3709f324a88e1adcf82bf93db2173eb8df146d7ee52f35ed50ce3813e9bb989d00f78f200d0ab4
6
+ metadata.gz: 14e4e920d24d0a3857dea918cbb318030887c4d5c2ee2c8c27bff61d547fb8c86cc54b573ff142d13c32daf78fbf9efc289d4204d16615cbcee1fbf1b583b5b5
7
+ data.tar.gz: bfa543caebda04f6bb6ccec07c93bda3b8e57e2f94a63b3221ffa04294467fb88ff9cdbb72ade621450554ff44f103efb932734f81aaa66cc7018cc8b16799d1
@@ -53,6 +53,8 @@ module De
53
53
  private
54
54
 
55
55
  def parse_field(object, field, value)
56
+ return if value.nil?
57
+
56
58
  parsed_value = field.parse(value)
57
59
 
58
60
  return if parsed_value.nil?
@@ -11,6 +11,8 @@ module Ializer
11
11
  end
12
12
 
13
13
  def self.parse(value)
14
+ return nil if value.nil?
15
+
14
16
  BigDecimal(value)
15
17
  end
16
18
  end
@@ -10,7 +10,7 @@ module Ializer
10
10
 
11
11
  def self.parse(value)
12
12
  Date.parse(value)
13
- rescue ArgumentError
13
+ rescue ArgumentError, TypeError
14
14
  nil
15
15
  end
16
16
  end
@@ -9,6 +9,8 @@ module Ializer
9
9
  end
10
10
 
11
11
  def self.parse(value)
12
+ return nil if value.nil?
13
+
12
14
  Time.at(value / 1000.0)
13
15
  end
14
16
  end
@@ -7,6 +7,8 @@ module Ializer
7
7
  end
8
8
 
9
9
  def self.parse(value)
10
+ return nil if value.nil?
11
+
10
12
  value.to_sym
11
13
  end
12
14
  end
@@ -10,6 +10,8 @@ module Ializer
10
10
 
11
11
  def self.parse(value)
12
12
  DateTime.iso8601 value
13
+ rescue ArgumentError
14
+ nil
13
15
  end
14
16
  end
15
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ializer
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Steinberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-24 00:00:00.000000000 Z
11
+ date: 2020-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport