params-registry 0.1.5 → 0.1.6

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: a042bd9fe8e18875fbe751867cf08830d8e23e965c0b4c9053e1948a474fe6da
4
- data.tar.gz: 37c92f7e5de26e422eda6441696c17319009edf0a57eeac813f118b8d7055c7b
3
+ metadata.gz: a2c64c0a41224198bdd02db7960b2051e74726bf690ddc66b222bc077bdeafd0
4
+ data.tar.gz: 5bd14e8bb789ea29ebca723e13edd08a51174b37aaa15fdec7829041025d471f
5
5
  SHA512:
6
- metadata.gz: 3e0c5afa52cc9fde678195fdc48e52c470ca7061d70f478216937a8485b38c5f071904992b53370ce8fba63cbbe397041cbf1c852f476b99edd548f756cad25d
7
- data.tar.gz: 39e52f72ecf4f60f7834d9f406a5cb98f2d9e161ea5bfe01d34fb3ae821dbb454f4813286056e772457b4a9f1caae75d12681d98220db8c945ba858652c5996e
6
+ metadata.gz: 6f66092cfb1c2c047d6da054b295fa6dfd7796c9f01fe7543d9bfe680e5a57f0602fe48ae6f3733a8e65ea24fa29ad21ade20d18b90259a9784008f4e0876d7d
7
+ data.tar.gz: e9a801b3893c7eb6a99eada97974750a1f78dd6a084202b0d7545b7464486770e062a4b138cf5466a242cf32f84a38990bc423261ea80ecf61e9e112b3858750
@@ -172,11 +172,24 @@ class Params::Registry::Instance
172
172
 
173
173
  # Taxidermy this object as an ordinary hash.
174
174
  #
175
+ # @param slugs [true, false] whether to use slugs versus canonical keys.
176
+ # @param extra [false, true] whether to include the "extra" parameters.
177
+ #
175
178
  # @return [Hash] basically the same thing, minus its metadata.
176
179
  #
177
- def to_h
180
+ def to_h slugs: true, extra: false
181
+ # we're gonna do damage, lol
182
+ out = @content.dup
183
+
184
+ # this should work?
185
+ out.transform_keys! do |k|
186
+ registry[@group][k].slug || k.to_s.to_sym
187
+ end if slugs
188
+
178
189
  # XXX maybe enforce the ordering better??
179
- @content.merge @extra
190
+ out.merge! @extra if extra
191
+
192
+ out
180
193
  end
181
194
 
182
195
  # Retrieve an {Params::Registry::Instance} that isolates the
@@ -3,6 +3,6 @@
3
3
  module Params
4
4
  class Registry
5
5
  # The module version
6
- VERSION = "0.1.5"
6
+ VERSION = "0.1.6"
7
7
  end
8
8
  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.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Taylor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-04 00:00:00.000000000 Z
11
+ date: 2024-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-types