params-registry 0.1.0 → 0.1.2

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: 056d5ebab254d389e210590cfbb3e2f68302189933e1bb352cf857f78d5e4dbc
4
- data.tar.gz: 9269fd8561ff6fe8510dfdb2f3e5d7e003e0aba1a6a3fb1e9ec093c034a7c057
3
+ metadata.gz: 155fe142e33362d910c2682c207d9c01dd2ecdccfeaeec4b6953da96825e33d6
4
+ data.tar.gz: 7a991e0a0b3d5552251bdc26912261561acf0667f6bfbf5b7996c43cf8b577d8
5
5
  SHA512:
6
- metadata.gz: be1ccb24babc79fd919b1781fab9cf3f354519eb85ea95336f6c4edcb6758c24f4735b468f887f74eb278428d3c01bd72ceba322491ade5adab6d428ac501310
7
- data.tar.gz: 2c4e8fec183a9d60bbfe440baaacc0e8674533d300c65ba404d7b603e208396152dfaf8d9e557a6bb10981f79fdcbb75863afca4b042be61381df7a1fa897593
6
+ metadata.gz: 7c1c7aa4cadcf3d98642a2bad6ef69f2fdb6001b331631e9e7be07f46e210e2876168256323bf6bc34147e1e61a802a85c5acd8872c6db8bb19744926811fcc2
7
+ data.tar.gz: bc76e72afde35988ee907f3e54fdae0a2b4b4afbe64d05da0a5808a8e16bad87b3925347e7abd30efc10bfaf902479a91e6e69e35d74d9d4428285910f0e46b1
@@ -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
- Base10Integer = Nominal::Integer.constructor do |i|
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 = Base10Integer.constrained lteq: 0
56
+ NonPositiveInteger = DecimalInteger.constrained lteq: 0
57
57
  # `xsd:nonNegativeInteger`
58
- NonNegativeInteger = Base10Integer.constrained gteq: 0
58
+ NonNegativeInteger = DecimalInteger.constrained gteq: 0
59
59
  # `xsd:positiveInteger`
60
- PositiveInteger = Base10Integer.constrained gt: 0
60
+ PositiveInteger = DecimalInteger.constrained gt: 0
61
61
  # `xsd:negativeInteger`
62
- NegativeInteger = Base10Integer.constrained lt: 0
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 (Base10Integer[x] rescue nil) then ::Time.at(Base10Integer[x])
124
+ when (DecimalInteger[x] rescue nil) then ::Time.at(DecimalInteger[x])
125
125
  else ::Time.parse x
126
126
  end
127
127
  end
@@ -3,6 +3,6 @@
3
3
  module Params
4
4
  class Registry
5
5
  # The module version
6
- VERSION = "0.1.0"
6
+ VERSION = "0.1.2"
7
7
  end
8
8
  end
@@ -129,6 +129,12 @@ class Params::Registry
129
129
  #
130
130
  def keys ; @templates.keys; end
131
131
 
132
+ # Return the template entries, in order.
133
+ #
134
+ # @return [Array<Params::Registry::Template>] the templates.
135
+ #
136
+ def templates ; @templates.values; end
137
+
132
138
  # Return the canonical identifier for the template.
133
139
  #
134
140
  # @param id [Object] the identifier, canonical or otherwise.
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.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Taylor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-23 00:00:00.000000000 Z
11
+ date: 2024-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-types