ializer 0.7.0 → 0.8.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: f2edc7490772cdd678feb9fc5f2edc25f9898dfdd85cd1a7010c31ae17c7e907
4
- data.tar.gz: 22436136f76f5d7ab9be4c9e853f3b971751683d3f08fbe8990b079de543bfef
3
+ metadata.gz: 99faa3c4e7cca943f993c112f46b36f7d36029e1bb4910699e21503b7bf3b74a
4
+ data.tar.gz: 85b7a7155bb42711a6c618a27fd350b6430705a53844f333bb9dfbae631f83d4
5
5
  SHA512:
6
- metadata.gz: 1638343079a2be6f0c0ab984255ea8bb4255eb543d2a1b4564fa00f9756f73a8baf04356b39667595b49c6eeb673dab7a762b25ff348e494bd31ef60cf644a46
7
- data.tar.gz: 1fa34143f0c485ffb25ff602cb98f02f02ea519456ff81ce97ede39890794f35fd53a714e65399a0418275fbc9f4345ccd6c3f4cf1c29df730fc64af4f507a21
6
+ metadata.gz: e166c8c90c4cbc1b9535c45c2f0cb76ee1e7f048db28b65a71bcabab8a63832a31fbdba59c1ec1d239b939557fe1e9fd6382373b9435d420022c85a01289b3d9
7
+ data.tar.gz: dd84708200796c3b9dbfd5ad78496c41ee9cd72c7b77844c3933eab55fa531a20411adc36444152ed11242c0a6d4a7c8951aa626f62bb7dc578ea60ab23a802b
@@ -14,6 +14,8 @@ module Ializer
14
14
  return nil if value.nil?
15
15
 
16
16
  BigDecimal(value)
17
+ rescue ArgumentError
18
+ value
17
19
  end
18
20
  end
19
21
  end
@@ -11,7 +11,7 @@ module Ializer
11
11
  def self.parse(value)
12
12
  Date.parse(value)
13
13
  rescue ArgumentError, TypeError
14
- nil
14
+ value
15
15
  end
16
16
  end
17
17
  end
@@ -9,6 +9,8 @@ module Ializer
9
9
  def self.parse(value)
10
10
  return value if value.is_a? Numeric
11
11
 
12
+ return nil if value.nil?
13
+
12
14
  value.to_i
13
15
  end
14
16
  end
@@ -23,6 +23,8 @@ module Ializer
23
23
 
24
24
  return Float::INFINITY if value == INFINITY_STRING
25
25
 
26
+ return nil if value.nil?
27
+
26
28
  value.to_f
27
29
  end
28
30
  end
@@ -10,6 +10,8 @@ module Ializer
10
10
  return nil if value.nil?
11
11
 
12
12
  value.to_sym
13
+ rescue NoMethodError
14
+ value
13
15
  end
14
16
  end
15
17
  end
@@ -11,7 +11,7 @@ module Ializer
11
11
  def self.parse(value)
12
12
  DateTime.iso8601 value
13
13
  rescue ArgumentError
14
- nil
14
+ value
15
15
  end
16
16
  end
17
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ializer
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.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.7.0
4
+ version: 0.8.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-06-02 00:00:00.000000000 Z
11
+ date: 2020-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport