prolog-dry_types 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prolog/dry_types/integer_range.rb +3 -3
- data/lib/prolog/dry_types/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32a26be2140bf1cd30cc480eef7d09b5f6590cd3
|
4
|
+
data.tar.gz: 4de91889e5f4a1f7e7e5df20229c9891df22c95c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dbea9cbcd95e51f3dbced05eb38e781e7302fc52f31bd9a2db9257302d0fbaf718e06df4ebd9edfb7f99018e99c0846d62fe3aa65b5edd1e6be787f95982476
|
7
|
+
data.tar.gz: 56114555b98e78634e0b604cb69d19f5a7d6b8404e02ccf8e06c09e370d8bc55ddb34f8b0903dd8ad4ee61ecee604b6b1bf650dfd815dfc2facbf0aa18523a7c
|
@@ -13,9 +13,9 @@ module Types
|
|
13
13
|
# reflection, this makes little sense as a general-purpose behaviour, as it is
|
14
14
|
# highly likely to surprise casual users.
|
15
15
|
IntegerRange = Range.constructor do |value|
|
16
|
-
if value.
|
17
|
-
value
|
18
|
-
else
|
16
|
+
if value.respond_to?(:minmax) # Enumerable; eg, Range or Array
|
17
|
+
value.min..value.max
|
18
|
+
else # it *better* be an Integer
|
19
19
|
0..value.to_i
|
20
20
|
end
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prolog-dry_types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Dickey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-types
|