hash_order_helper 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 +4 -4
- data/README.md +2 -2
- data/hash_order_helper.gemspec +1 -1
- data/lib/hash_order_helper.rb +3 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0ed60309ad0a91aa664725e5e727c2b9521a18a
|
4
|
+
data.tar.gz: 6416020a3396cfab63752cf0b4957ea8c0a8d2b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da8df1efeebf976c8b4aef15222c33bdf253e38b880d5b14e083066efac2ea34756a35d8b41d503d27a9ab5224c3151f5b29abefffd8424bb1fc26ef5774a766
|
7
|
+
data.tar.gz: d45e901e181fde9fde9500a5283e63d43377bace87008b4b4180833ebf852a5e698da83cda75f0975f097b43891e06a901eef2dcb2f76654a5db3a41d0e2e26c
|
data/README.md
CHANGED
@@ -45,9 +45,9 @@ The following methods are added:
|
|
45
45
|
* `last -> Array`
|
46
46
|
* `last(n) -> Array`
|
47
47
|
* `pop -> Array`
|
48
|
-
* `pop(n) -> Array`
|
48
|
+
* `pop(n) -> Array`
|
49
49
|
* `nd_push(hash) -> Hash` **non-destructive** (alias: `+`)
|
50
|
-
* `push(hash) -> Hash`
|
50
|
+
* `push(hash) -> Hash` (alias: `<<`)
|
51
51
|
* `nd_unshift(hash) -> Hash` **non-destructive**
|
52
52
|
* `unshift(hash) -> Hash`
|
53
53
|
* `>>(receiver_hash) -> Hash`
|
data/hash_order_helper.gemspec
CHANGED
data/lib/hash_order_helper.rb
CHANGED
@@ -32,6 +32,7 @@ module HashOrderHelper
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def insert(nth, insert_hash)
|
35
|
+
insert_hash ||= {}
|
35
36
|
hash_keys = self.keys
|
36
37
|
hash_keys.insert(nth, *insert_hash.keys)
|
37
38
|
new_hash = {}
|
@@ -66,6 +67,7 @@ module HashOrderHelper
|
|
66
67
|
end
|
67
68
|
|
68
69
|
def nd_push(push_hash)
|
70
|
+
push_hash ||= {}
|
69
71
|
hash_keys = self.keys - push_hash.keys
|
70
72
|
hash_keys.push(*push_hash.keys)
|
71
73
|
new_hash = {}
|
@@ -85,6 +87,7 @@ module HashOrderHelper
|
|
85
87
|
alias << push
|
86
88
|
|
87
89
|
def nd_unshift(unshift_hash)
|
90
|
+
unshift_hash ||= {}
|
88
91
|
hash_keys = self.keys - unshift_hash.keys
|
89
92
|
hash_keys.unshift(*unshift_hash.keys)
|
90
93
|
new_hash = {}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hash_order_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.5.2
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Add methods to manipulate the order of the entries in the Hash object.
|