params-registry 0.1.2 → 0.1.3

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: 155fe142e33362d910c2682c207d9c01dd2ecdccfeaeec4b6953da96825e33d6
4
- data.tar.gz: 7a991e0a0b3d5552251bdc26912261561acf0667f6bfbf5b7996c43cf8b577d8
3
+ metadata.gz: 624a80ddabb8e69e586c3350a22bab9717af67818b97618425f0093606b684a6
4
+ data.tar.gz: bce074ab33e21da81a969cd0e780c1b296a7ec0e8b4a738cd3e08da098add826
5
5
  SHA512:
6
- metadata.gz: 7c1c7aa4cadcf3d98642a2bad6ef69f2fdb6001b331631e9e7be07f46e210e2876168256323bf6bc34147e1e61a802a85c5acd8872c6db8bb19744926811fcc2
7
- data.tar.gz: bc76e72afde35988ee907f3e54fdae0a2b4b4afbe64d05da0a5808a8e16bad87b3925347e7abd30efc10bfaf902479a91e6e69e35d74d9d4428285910f0e46b1
6
+ metadata.gz: d50aa5edb159bc4159b6d93abe11ef251c2a571bc5a2d3935bb17e743e5027aae20caa9ce757be82b70c77cdfbaea6464afd969da77813fbe44efa2b18ce9ea7
7
+ data.tar.gz: d893ba746adaa6cdf04f17022f31452ed88a506c70f1060e519603627784ed3e51d0e7cd52a52d14a66d43882c5ab7d6bb9da2c76cd52e8798d0b36f5c9f1157
@@ -11,6 +11,13 @@ class Params::Registry::Template
11
11
  # this is dumb
12
12
  Types = Params::Registry::Types
13
13
 
14
+ # Post-initialization hook for subclasses, because the constructor
15
+ # is so hairy.
16
+ #
17
+ # @return [void]
18
+ #
19
+ def post_init; end
20
+
14
21
  public
15
22
 
16
23
  # Initialize the template object.
@@ -81,6 +88,8 @@ class Params::Registry::Template
81
88
  @unwind = Types::Proc[unwind] if unwind
82
89
  @reverse = Types::Bool[reverse]
83
90
 
91
+ # post-initialization hook
92
+ post_init
84
93
  end
85
94
 
86
95
  # @!attribute [r] registry
@@ -212,6 +221,18 @@ class Params::Registry::Template
212
221
  #
213
222
  def complement? ; !!@complement; end
214
223
 
224
+ # @!attribute [r] blank?
225
+ # Returns true if the template has no configuration data to speak of.
226
+ # @return [Boolean]
227
+ def blank?
228
+ # XXX PHEWWW
229
+ @slug.nil? && @type == Types::NormalizedString && @composite.nil? &&
230
+ @format.nil? && @aliases.empty? && @depends.empty? &&
231
+ @conflicts.empty? && @consumes.empty? && @preproc.nil? &&
232
+ @min == 0 && @max.nil? && !@shift && !@empty && @default.nil? &&
233
+ @unifunc.nil? && @complement.nil? && @unwind.nil? && !@reverse
234
+ end
235
+
215
236
  # Preprocess a parameter value against itself and/or `consume`d values.
216
237
  #
217
238
  # @param myself [Array] raw values for the parameter itself.
@@ -3,6 +3,6 @@
3
3
  module Params
4
4
  class Registry
5
5
  # The module version
6
- VERSION = "0.1.2"
6
+ VERSION = "0.1.3"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: params-registry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Taylor