nrser 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nrser/core_ext/hash.rb +1 -14
- data/lib/nrser/core_ext/hash/bury.rb +20 -0
- data/lib/nrser/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c22fc11ecea67d2e92ae41a8cf469a7f33d9cf88
|
4
|
+
data.tar.gz: bed78e5268a47d2e8e64c1f124e6fedb8e8ca900
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 678f023739443e98fca66a347a4ce7e3077b0245ad75dfce625a2a53aa44e93cac9d65ddaf2662c93117427da054ebe53b6812d1ca9dc91182fbed41a80cda80
|
7
|
+
data.tar.gz: 47f21b60c61f23e5eff76c627d805ce62f60a9be852f02d0eee8fa95fb7c912f1581632d099408a2b9f8cff361829a301224537b2514fa641bcbc345b3d72117
|
data/lib/nrser/core_ext/hash.rb
CHANGED
@@ -4,6 +4,7 @@ require 'nrser/ext/tree'
|
|
4
4
|
|
5
5
|
require_relative './hash/extract_values_at'
|
6
6
|
require_relative './hash/transform_values_with_keys'
|
7
|
+
require_relative './hash/bury'
|
7
8
|
|
8
9
|
class Hash
|
9
10
|
include NRSER::Ext::Tree
|
@@ -22,20 +23,6 @@ class Hash
|
|
22
23
|
def to_options! *args, █ symbolize_keys! *args, █ end
|
23
24
|
def to_options *args, █ symbolize_keys *args, █ end
|
24
25
|
|
25
|
-
|
26
|
-
# See {NRSER.bury!}
|
27
|
-
def bury! key_path,
|
28
|
-
value,
|
29
|
-
parsed_key_type: :guess,
|
30
|
-
clobber: false
|
31
|
-
NRSER.bury! self,
|
32
|
-
key_path,
|
33
|
-
value,
|
34
|
-
parsed_key_type: parsed_key_type,
|
35
|
-
clobber: clobber
|
36
|
-
end
|
37
|
-
|
38
|
-
|
39
26
|
# Checks that `self` contains a single key/value pair (`#length` of 1)
|
40
27
|
# and returns it as an array of length 2.
|
41
28
|
#
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'active_support/core_ext/object/deep_dup'
|
2
|
+
|
3
|
+
class Hash
|
4
|
+
|
5
|
+
# See {NRSER.bury!}
|
6
|
+
def bury! key_path,
|
7
|
+
value,
|
8
|
+
parsed_key_type: :guess,
|
9
|
+
clobber: false
|
10
|
+
NRSER.bury! self,
|
11
|
+
key_path,
|
12
|
+
value,
|
13
|
+
parsed_key_type: parsed_key_type,
|
14
|
+
clobber: clobber
|
15
|
+
end
|
16
|
+
|
17
|
+
def bury *args, &block
|
18
|
+
deep_dup.tap { |hash| hash.bury! *args, &block }
|
19
|
+
end
|
20
|
+
end
|
data/lib/nrser/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nrser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nrser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hamster
|
@@ -239,6 +239,7 @@ files:
|
|
239
239
|
- lib/nrser/core_ext/enumerable/find_map.rb
|
240
240
|
- lib/nrser/core_ext/exception.rb
|
241
241
|
- lib/nrser/core_ext/hash.rb
|
242
|
+
- lib/nrser/core_ext/hash/bury.rb
|
242
243
|
- lib/nrser/core_ext/hash/extract_values_at.rb
|
243
244
|
- lib/nrser/core_ext/hash/transform_values_with_keys.rb
|
244
245
|
- lib/nrser/core_ext/module.rb
|