attr_typed 1.0.3 → 1.0.4

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
  SHA1:
3
- metadata.gz: 501dbacb5b454c928d5c5ec632670f4b4d6f380d
4
- data.tar.gz: d180ae99d5503d7ed1ab696a2dec98355324c254
3
+ metadata.gz: 2fd0d369a3a45a372c8fe94a594be556753ab6f2
4
+ data.tar.gz: 2a6ff39876920fe026222d7aa7c1c028a273267f
5
5
  SHA512:
6
- metadata.gz: 9a20972524b5bc82a43a4c9f69da979cf931f1eb725c65c41e1d9ea7fcadd291f9d4cae9d989774f2fafda700cb929430ea03b6c3054322c2d887e01931b6fe5
7
- data.tar.gz: bee107282a4a528bc64381ff197909dc4e6c052d2ff3d3608ee5b87c0f053804236e4b8959987d964babfcee3a7c0ff71deebbc18af34d2f49d80edc5230589b
6
+ metadata.gz: 062435c50d5c3bf25f7494e1a3d2522027cd698e6129ff34873e26f66d368c3773ceb3591d4d3ee49a98ec833b435d88efe8028ff069ba27a22373c6ec1374c4
7
+ data.tar.gz: 00a827d0603d6cc40e95e5f24b396c708f3d88195bf82427209c6fe0277f46a87870f8a88d947a28e30b7989d50c70cdf6fb8fd62473662a1936e7fdb0788c4c
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  Gemfile.lock
2
+ pkg/
data/lib/attr_typed.rb CHANGED
@@ -49,6 +49,7 @@ module AttrTyped
49
49
 
50
50
  def parse_strict_integer(value)
51
51
  return value if value.nil? || value.is_a?(Integer)
52
+ return value.to_i if value.is_a?(Float) || value.is_a?(BigDecimal)
52
53
  Integer(value, 10)
53
54
  rescue ArgumentError
54
55
  nil
@@ -1,3 +1,3 @@
1
1
  module AttrTyped
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attr_typed
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Langhorne