params-registry 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/params/registry/types.rb +6 -6
- data/lib/params/registry/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e322daa4a45ff87f3fccdd1f087509f33326015b4b0af1a574fbe35734a13f05
|
4
|
+
data.tar.gz: 0f778a412f222d3ce9acecd846d63868c1882756a6a4068e30c9f71c5b649ff0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f163a5ef25f963c8a61d4f86711fff0d255b47265372f51e18db446548cef81208ab75cdc666db4b9d804487417a433adbe15bd59e3cb349dee6f7e8c5d6042
|
7
|
+
data.tar.gz: 0ed8a0de01b76b888e010da5d5ebe9c698fc2906fa67ca3a5ae672e67f7c01058bc803386473749a223511447d1829fe568cb5db59c391bd6e7d9f0176942a6b
|
@@ -48,18 +48,18 @@ module Params::Registry::Types
|
|
48
48
|
# The problem with Kernel.Integer is that if a string representing
|
49
49
|
# a number begins with a zero it's treated as octal, so we have to
|
50
50
|
# compensate for that.
|
51
|
-
|
51
|
+
DecimalInteger = Nominal::Integer.constructor do |i|
|
52
52
|
i.is_a?(::Numeric) ? i.to_i : ::Kernel.Integer(i.to_s, 10)
|
53
53
|
end
|
54
54
|
|
55
55
|
# `xsd:nonPositiveInteger`
|
56
|
-
NonPositiveInteger =
|
56
|
+
NonPositiveInteger = DecimalInteger.constrained lteq: 0
|
57
57
|
# `xsd:nonNegativeInteger`
|
58
|
-
NonNegativeInteger =
|
58
|
+
NonNegativeInteger = DecimalInteger.constrained gteq: 0
|
59
59
|
# `xsd:positiveInteger`
|
60
|
-
PositiveInteger =
|
60
|
+
PositiveInteger = DecimalInteger.constrained gt: 0
|
61
61
|
# `xsd:negativeInteger`
|
62
|
-
NegativeInteger =
|
62
|
+
NegativeInteger = DecimalInteger.constrained lt: 0
|
63
63
|
|
64
64
|
# @!group Stringy stuff, à la XSD plus some others
|
65
65
|
|
@@ -121,7 +121,7 @@ module Params::Registry::Types
|
|
121
121
|
Time = self.Constructor(::Time) do |x|
|
122
122
|
case x
|
123
123
|
when ::Array then ::Time.new(*x)
|
124
|
-
when (
|
124
|
+
when (DecimalInteger[x] rescue nil) then ::Time.at(DecimalInteger[x])
|
125
125
|
else ::Time.parse x
|
126
126
|
end
|
127
127
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: params-registry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-types
|