nice_hash 1.16.3 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/nice/hash/add_to_ruby.rb +13 -5
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8319335fc75dd3ea181a84bdc8a67adf979b42e2fde45b4b2c1686927b877886
|
4
|
+
data.tar.gz: f0ca1147eb97015392f846a8449dac01c4df5f223336fc69aa7c83b8dd5dbc01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac548edf37ae74f11a21368c8b5f02d061b33a6fe2749f39f88cb10371e93701fe0ce53e548cf7c67ac968e2fced504fa709716597c0e498e26db0bc29863ee4
|
7
|
+
data.tar.gz: 7fe62a823ffe2b59048225847d83d684792c0097801d72707f4a74e89f138c6a7d61b6181a919964671463754ac7ac990646a8cb3d01f9a2aaaff3317bf8d9ae
|
data/README.md
CHANGED
@@ -900,6 +900,17 @@ value.is_a?(Boolean) #> true
|
|
900
900
|
text.is_a?(Boolean) #> false
|
901
901
|
|
902
902
|
```
|
903
|
+
|
904
|
+
#### in?(array)
|
905
|
+
Added method in? to all objects that accepts array as a parameter.
|
906
|
+
|
907
|
+
```ruby
|
908
|
+
'uno'.in?(['uno','dos']) #> true
|
909
|
+
:uno.in? [:uno, :dos] #> true
|
910
|
+
5.in? [1,2,3,4,6] #> false
|
911
|
+
|
912
|
+
```
|
913
|
+
|
903
914
|
### Other tools integration
|
904
915
|
|
905
916
|
#### Tabulo
|
@@ -292,12 +292,12 @@ class Hash
|
|
292
292
|
alias patterns pattern_fields
|
293
293
|
end
|
294
294
|
|
295
|
-
###########################################################################
|
296
|
-
# symbolize hash of arrays and array of hashes
|
297
|
-
# Taken from gist https://gist.github.com/Integralist/9503099
|
298
|
-
# Thanks to @integralist
|
299
|
-
###########################################################################
|
300
295
|
class Object
|
296
|
+
###########################################################################
|
297
|
+
# symbolize hash of arrays and array of hashes
|
298
|
+
# Taken from gist https://gist.github.com/Integralist/9503099
|
299
|
+
# Thanks to @integralist
|
300
|
+
###########################################################################
|
301
301
|
def deep_symbolize_keys
|
302
302
|
if is_a? Hash
|
303
303
|
return reduce({}) do |memo, (k, v)|
|
@@ -312,6 +312,14 @@ class Object
|
|
312
312
|
end
|
313
313
|
self
|
314
314
|
end
|
315
|
+
|
316
|
+
###########################################################################
|
317
|
+
# include? but the opposite. Check if the object is included on the array
|
318
|
+
###########################################################################
|
319
|
+
def in?(array)
|
320
|
+
array.include?(self)
|
321
|
+
end
|
322
|
+
|
315
323
|
end
|
316
324
|
|
317
325
|
class Array
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nice_hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: string_pattern
|
@@ -36,20 +36,20 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 3.
|
39
|
+
version: 3.9.0
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '3.
|
42
|
+
version: '3.9'
|
43
43
|
type: :development
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 3.
|
49
|
+
version: 3.9.0
|
50
50
|
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '3.
|
52
|
+
version: '3.9'
|
53
53
|
description: 'NiceHash creates hashes following certain patterns so your testing will
|
54
54
|
be much easier. Parse and filter JSON. You can easily generate all the hashes you
|
55
55
|
want following the criteria you specify. Many other features coming to Hash class
|