augmented 0.2.0 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +11 -0
- data/README.md +132 -28
- data/augmented.gemspec +14 -8
- data/lib/augmented.rb +4 -0
- data/lib/augmented/arrays/tieable.rb +1 -1
- data/lib/augmented/enumerators/indexing.rb +3 -1
- data/lib/augmented/exceptions.rb +11 -0
- data/lib/augmented/exceptions/chain.rb +16 -0
- data/lib/augmented/exceptions/detailed.rb +22 -0
- data/lib/augmented/exceptions/serializable.rb +25 -0
- data/lib/augmented/objects/pickable.rb +2 -2
- data/lib/augmented/procs.rb +2 -2
- data/lib/augmented/procs/rescuable.rb +3 -3
- data/lib/augmented/strings.rb +9 -0
- data/lib/augmented/strings/blank.rb +15 -0
- data/lib/augmented/strings/truncatable.rb +20 -0
- data/lib/augmented/version.rb +1 -1
- metadata +26 -47
- data/test/augmented/arrays/tieable_test.rb +0 -66
- data/test/augmented/enumerators/indexing_test.rb +0 -15
- data/test/augmented/hashes/mappable_test.rb +0 -37
- data/test/augmented/hashes/polymorphable_test.rb +0 -45
- data/test/augmented/hashes/transformable_test.rb +0 -87
- data/test/augmented/modules/refined_test.rb +0 -27
- data/test/augmented/objects/iffy_test.rb +0 -69
- data/test/augmented/objects/pickable_test.rb +0 -39
- data/test/augmented/objects/tackable_test.rb +0 -25
- data/test/augmented/objects/tappable_test.rb +0 -141
- data/test/augmented/objects/thru_test.rb +0 -98
- data/test/augmented/procs/chainable_test.rb +0 -22
- data/test/augmented/procs/rescuable_test.rb +0 -38
- data/test/augmented/symbols/arguable_test.rb +0 -51
- data/test/augmented/symbols/comparing_test.rb +0 -131
data/lib/augmented/procs.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
module Augmented
|
|
2
2
|
module Procs
|
|
3
3
|
module Rescuable
|
|
4
|
-
|
|
4
|
+
NOT_PROVIDED = Object.new
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
refine Proc do
|
|
7
7
|
|
|
8
8
|
def rescues exception_class, return_value = NOT_PROVIDED, &block
|
|
9
9
|
raise ArgumentError, 'must provide a return value or block' if return_value == NOT_PROVIDED && !block_given?
|
|
@@ -12,7 +12,7 @@ module Augmented
|
|
|
12
12
|
|
|
13
13
|
Proc.new do |*args|
|
|
14
14
|
begin
|
|
15
|
-
original.call
|
|
15
|
+
original.call(*args)
|
|
16
16
|
rescue exception_class => exception
|
|
17
17
|
block ? block.call(exception) : return_value
|
|
18
18
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Augmented
|
|
2
|
+
module Strings
|
|
3
|
+
module Truncatable
|
|
4
|
+
refine String do
|
|
5
|
+
|
|
6
|
+
def truncate length
|
|
7
|
+
raise ArgumentError, 'length must be a non-negative integer' unless length && length.to_int >= 0
|
|
8
|
+
|
|
9
|
+
slice(0, length)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def truncate! length
|
|
13
|
+
replace(truncate(length))
|
|
14
|
+
self
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/lib/augmented/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: augmented
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
8
|
-
autorequire:
|
|
7
|
+
- brunze
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-05-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -16,37 +16,37 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '2'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '2'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
33
|
+
version: 13.0.3
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
40
|
+
version: 13.0.3
|
|
41
41
|
description: Adds a few useful extra methods to some of Ruby's core types, available
|
|
42
42
|
as refinements.
|
|
43
43
|
email:
|
|
44
|
-
- bruno@brunze.com
|
|
45
44
|
executables: []
|
|
46
45
|
extensions: []
|
|
47
46
|
extra_rdoc_files: []
|
|
48
47
|
files:
|
|
49
48
|
- ".gitignore"
|
|
49
|
+
- CHANGELOG.md
|
|
50
50
|
- Gemfile
|
|
51
51
|
- LICENSE.txt
|
|
52
52
|
- README.md
|
|
@@ -57,6 +57,10 @@ files:
|
|
|
57
57
|
- lib/augmented/arrays/tieable.rb
|
|
58
58
|
- lib/augmented/enumerators.rb
|
|
59
59
|
- lib/augmented/enumerators/indexing.rb
|
|
60
|
+
- lib/augmented/exceptions.rb
|
|
61
|
+
- lib/augmented/exceptions/chain.rb
|
|
62
|
+
- lib/augmented/exceptions/detailed.rb
|
|
63
|
+
- lib/augmented/exceptions/serializable.rb
|
|
60
64
|
- lib/augmented/hashes.rb
|
|
61
65
|
- lib/augmented/hashes/mappable.rb
|
|
62
66
|
- lib/augmented/hashes/polymorphable.rb
|
|
@@ -72,30 +76,21 @@ files:
|
|
|
72
76
|
- lib/augmented/procs.rb
|
|
73
77
|
- lib/augmented/procs/chainable.rb
|
|
74
78
|
- lib/augmented/procs/rescuable.rb
|
|
79
|
+
- lib/augmented/strings.rb
|
|
80
|
+
- lib/augmented/strings/blank.rb
|
|
81
|
+
- lib/augmented/strings/truncatable.rb
|
|
75
82
|
- lib/augmented/symbols.rb
|
|
76
83
|
- lib/augmented/symbols/arguable.rb
|
|
77
84
|
- lib/augmented/symbols/comparing.rb
|
|
78
85
|
- lib/augmented/version.rb
|
|
79
|
-
- test/augmented/arrays/tieable_test.rb
|
|
80
|
-
- test/augmented/enumerators/indexing_test.rb
|
|
81
|
-
- test/augmented/hashes/mappable_test.rb
|
|
82
|
-
- test/augmented/hashes/polymorphable_test.rb
|
|
83
|
-
- test/augmented/hashes/transformable_test.rb
|
|
84
|
-
- test/augmented/modules/refined_test.rb
|
|
85
|
-
- test/augmented/objects/iffy_test.rb
|
|
86
|
-
- test/augmented/objects/pickable_test.rb
|
|
87
|
-
- test/augmented/objects/tackable_test.rb
|
|
88
|
-
- test/augmented/objects/tappable_test.rb
|
|
89
|
-
- test/augmented/objects/thru_test.rb
|
|
90
|
-
- test/augmented/procs/chainable_test.rb
|
|
91
|
-
- test/augmented/procs/rescuable_test.rb
|
|
92
|
-
- test/augmented/symbols/arguable_test.rb
|
|
93
|
-
- test/augmented/symbols/comparing_test.rb
|
|
94
86
|
homepage: https://github.com/brunze/augmented
|
|
95
87
|
licenses:
|
|
96
88
|
- MIT
|
|
97
|
-
metadata:
|
|
98
|
-
|
|
89
|
+
metadata:
|
|
90
|
+
homepage_uri: https://github.com/brunze/augmented
|
|
91
|
+
source_code_uri: https://github.com/brunze/augmented
|
|
92
|
+
changelog_uri: https://github.com/brunze/augmented/CHANGELOG.md
|
|
93
|
+
post_install_message:
|
|
99
94
|
rdoc_options: []
|
|
100
95
|
require_paths:
|
|
101
96
|
- lib
|
|
@@ -110,24 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
110
105
|
- !ruby/object:Gem::Version
|
|
111
106
|
version: '0'
|
|
112
107
|
requirements: []
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
signing_key:
|
|
108
|
+
rubygems_version: 3.2.18
|
|
109
|
+
signing_key:
|
|
116
110
|
specification_version: 4
|
|
117
111
|
summary: Useful extra methods for some Ruby core types.
|
|
118
|
-
test_files:
|
|
119
|
-
- test/augmented/arrays/tieable_test.rb
|
|
120
|
-
- test/augmented/enumerators/indexing_test.rb
|
|
121
|
-
- test/augmented/hashes/mappable_test.rb
|
|
122
|
-
- test/augmented/hashes/polymorphable_test.rb
|
|
123
|
-
- test/augmented/hashes/transformable_test.rb
|
|
124
|
-
- test/augmented/modules/refined_test.rb
|
|
125
|
-
- test/augmented/objects/iffy_test.rb
|
|
126
|
-
- test/augmented/objects/pickable_test.rb
|
|
127
|
-
- test/augmented/objects/tackable_test.rb
|
|
128
|
-
- test/augmented/objects/tappable_test.rb
|
|
129
|
-
- test/augmented/objects/thru_test.rb
|
|
130
|
-
- test/augmented/procs/chainable_test.rb
|
|
131
|
-
- test/augmented/procs/rescuable_test.rb
|
|
132
|
-
- test/augmented/symbols/arguable_test.rb
|
|
133
|
-
- test/augmented/symbols/comparing_test.rb
|
|
112
|
+
test_files: []
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
require 'minitest/autorun'
|
|
2
|
-
require 'augmented/arrays/tieable'
|
|
3
|
-
|
|
4
|
-
describe Augmented::Arrays::Tieable do
|
|
5
|
-
using Augmented::Arrays::Tieable
|
|
6
|
-
|
|
7
|
-
describe '#tie' do
|
|
8
|
-
|
|
9
|
-
describe 'when supplied with an object' do
|
|
10
|
-
|
|
11
|
-
it 'returns an array interweaved with the specified object' do
|
|
12
|
-
object = Object.new
|
|
13
|
-
weaved = %w(a b c).tie object
|
|
14
|
-
|
|
15
|
-
weaved.must_equal ['a', object, 'b', object, 'c']
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it 'returns an empty array if the original array is empty' do
|
|
19
|
-
[].tie(1).must_equal []
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it 'returns the original array if it has only one element' do
|
|
23
|
-
[42].tie(1).must_equal [42]
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
describe 'when supplied with a block' do
|
|
29
|
-
|
|
30
|
-
it 'returns an array interweaved with the result of invoking the block' do
|
|
31
|
-
values = [10 ,20].each
|
|
32
|
-
weaved = %w(a b c).tie{ values.next }
|
|
33
|
-
|
|
34
|
-
weaved.must_equal ['a', 10, 'b', 20, 'c']
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
it 'passes both neighbour values as arguments to the supplied block' do
|
|
38
|
-
weaved = [1, 5, 12].tie{ |a, b| a + b }
|
|
39
|
-
|
|
40
|
-
weaved.must_equal [1, 6, 5, 17, 12]
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it 'will weave nils if the block does not return anything else' do
|
|
44
|
-
weaved = [1, 2, 3].tie{}
|
|
45
|
-
|
|
46
|
-
weaved.must_equal [1, nil, 2, nil, 3]
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
it 'returns an empty array if the original arrays is empty' do
|
|
50
|
-
[].tie{ 1 }.must_equal []
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
it 'returns the original array if it has only one element' do
|
|
54
|
-
[42].tie{ 1 }.must_equal [42]
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
it 'raises an ArgumentError if not passed a non-nil object or block' do
|
|
60
|
-
proc{ [].tie }.must_raise ArgumentError
|
|
61
|
-
proc{ [].tie nil }.must_raise ArgumentError
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
end
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
require 'minitest/autorun'
|
|
2
|
-
require 'augmented/enumerators/indexing'
|
|
3
|
-
|
|
4
|
-
describe Augmented::Enumerators::Indexing do
|
|
5
|
-
using Augmented::Enumerators::Indexing
|
|
6
|
-
|
|
7
|
-
describe '#index_by' do
|
|
8
|
-
|
|
9
|
-
it 'returns a hash keyed by the results of invoking the criterion on every collection element and the values are the last element matching the criterion' do
|
|
10
|
-
['a', 'bbb', 'c', 'dd'].to_enum.index_by(&:length).must_equal({ 1 => 'c', 2 => 'dd', 3 => 'bbb' })
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
end
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
require 'minitest/autorun'
|
|
2
|
-
require 'augmented/hashes/mappable'
|
|
3
|
-
|
|
4
|
-
describe Augmented::Hashes::Mappable do
|
|
5
|
-
using Augmented::Hashes::Mappable
|
|
6
|
-
|
|
7
|
-
describe '#map_values' do
|
|
8
|
-
|
|
9
|
-
it 'returns a new hash with the same keys but transformed values' do
|
|
10
|
-
{ aa: 11, bb: 22 }.map_values{ |i| i * 3 }.must_equal({ aa: 33, bb: 66 })
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it 'also provides the key and hash to the tranformer function as additional arguments' do
|
|
14
|
-
hash = { aa: 11, bb: 22 }
|
|
15
|
-
result = hash.map_values{ |i, key, h| [key, h.object_id] }
|
|
16
|
-
|
|
17
|
-
result.values.must_equal [[:aa, hash.object_id], [:bb, hash.object_id]]
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
describe '#map_keys' do
|
|
23
|
-
|
|
24
|
-
it 'returns a new hash with the same values but transformed keys' do
|
|
25
|
-
{ aa: 11, bb: 22 }.map_keys{ |k| k.to_s[0] }.must_equal({ 'a' => 11, 'b' => 22 })
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it 'also provides the value and hash to the tranformer function as additional arguments' do
|
|
29
|
-
hash = { aa: 11, bb: 22 }
|
|
30
|
-
result = hash.map_keys{ |k, value, h| [value, h.object_id] }
|
|
31
|
-
|
|
32
|
-
result.keys.must_equal [[11, hash.object_id], [22, hash.object_id]]
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
end
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
require 'minitest/autorun'
|
|
2
|
-
require 'augmented/hashes/polymorphable'
|
|
3
|
-
require 'ostruct'
|
|
4
|
-
|
|
5
|
-
describe Augmented::Hashes::Polymorphable do
|
|
6
|
-
using Augmented::Hashes::Polymorphable
|
|
7
|
-
|
|
8
|
-
describe '#polymorph' do
|
|
9
|
-
|
|
10
|
-
it 'returns an object of the class specified by the `:type` attribute, initialized with the hash itself' do
|
|
11
|
-
object = { type: 'OpenStruct', speak: 'meeehh' }.polymorph
|
|
12
|
-
|
|
13
|
-
object.must_be_instance_of OpenStruct
|
|
14
|
-
object.speak.must_equal 'meeehh'
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe 'type attribute' do
|
|
18
|
-
|
|
19
|
-
it 'can also be a string key in the hash' do
|
|
20
|
-
{ 'type' => 'OpenStruct' }.polymorph.must_be_instance_of OpenStruct
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it 'can be an arbitrary attribute in the hash' do
|
|
24
|
-
{ lorem_ipsum: 'OpenStruct' }.polymorph(:lorem_ipsum).must_be_instance_of OpenStruct
|
|
25
|
-
{ 'lorem_ipsum' => 'OpenStruct' }.polymorph(:lorem_ipsum).must_be_instance_of OpenStruct
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it 'can be a class' do
|
|
29
|
-
{ type: OpenStruct }.polymorph().must_be_instance_of OpenStruct
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it 'can be a class passed directly to the method, ignoring the type attribute in the hash' do
|
|
33
|
-
{ type: 'TotallyIgnoredClass' }.polymorph(OpenStruct).must_be_instance_of OpenStruct
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it 'raises an error if it cannot find a type class' do
|
|
39
|
-
proc{ {}.polymorph }.must_raise ArgumentError
|
|
40
|
-
proc{ { type: nil }.polymorph }.must_raise ArgumentError
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
end
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
require 'minitest/autorun'
|
|
2
|
-
require 'augmented/hashes/transformable'
|
|
3
|
-
require 'ostruct'
|
|
4
|
-
|
|
5
|
-
describe Augmented::Hashes::Transformable do
|
|
6
|
-
using Augmented::Hashes::Transformable
|
|
7
|
-
|
|
8
|
-
describe '#transform(!)' do
|
|
9
|
-
|
|
10
|
-
it 'mutates the values of the given keys by applying their respective procables' do
|
|
11
|
-
hash = { thing1: 100, thing2: OpenStruct.new(random_method_name: 900) }.freeze
|
|
12
|
-
|
|
13
|
-
new_hash = hash.transform thing1: -> i { i * 3 }, thing2: :random_method_name
|
|
14
|
-
|
|
15
|
-
new_hash[:thing1].must_equal 300
|
|
16
|
-
new_hash[:thing2].must_equal 900
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# mutable version test:
|
|
20
|
-
hash = { thing1: 100, thing2: OpenStruct.new(random_method_name: 900) }
|
|
21
|
-
|
|
22
|
-
hash.transform! thing1: -> i { i * 3 }, thing2: :random_method_name
|
|
23
|
-
|
|
24
|
-
hash[:thing1].must_equal 300
|
|
25
|
-
hash[:thing2].must_equal 900
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it 'applies procables recursively when given a hash' do
|
|
29
|
-
hash = { a: { b: { c: 100 } } }.freeze
|
|
30
|
-
|
|
31
|
-
new_hash = hash.transform({ a: { b: { c: -> i { i * 3 } } } })
|
|
32
|
-
|
|
33
|
-
new_hash[:a][:b][:c].must_equal 300
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
# mutable version test:
|
|
37
|
-
hash = { a: { b: { c: 100 } } }
|
|
38
|
-
|
|
39
|
-
hash.transform!({ a: { b: { c: -> i { i * 3 } } } })
|
|
40
|
-
|
|
41
|
-
hash[:a][:b][:c].must_equal 300
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
it 'applies procables to all elements of a collection if a value is iterable (iterable MUST be a collection of hashes)' do
|
|
45
|
-
hash = { a: [ { my_value: 10 }, { my_value: 20 } ] }.freeze
|
|
46
|
-
|
|
47
|
-
new_hash = hash.transform(a: { my_value: -> i { i * 3 } })
|
|
48
|
-
|
|
49
|
-
new_hash[:a].must_equal [ { my_value: 30 }, { my_value: 60 } ]
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
# mutable version test:
|
|
53
|
-
hash = { a: [ { my_value: 10 }, { my_value: 20 } ] }
|
|
54
|
-
|
|
55
|
-
hash.transform!(a: { my_value: -> i { i * 3 } })
|
|
56
|
-
|
|
57
|
-
hash[:a].must_equal [ { my_value: 30 }, { my_value: 60 } ]
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
it 'can apply several procables to a value, supplied in an array, executed from left to right' do
|
|
61
|
-
add_ten = -> i { i + 10 }
|
|
62
|
-
double = -> i { i * 2 }
|
|
63
|
-
|
|
64
|
-
hash = { a: 2.5 }.freeze
|
|
65
|
-
|
|
66
|
-
new_hash = hash.transform a: [ :to_i, add_ten, double ]
|
|
67
|
-
|
|
68
|
-
new_hash[:a].must_equal 24
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
# mutable version test:
|
|
72
|
-
hash = { a: 2.5 }
|
|
73
|
-
|
|
74
|
-
hash.transform! a: [ :to_i, add_ten, double ]
|
|
75
|
-
|
|
76
|
-
hash[:a].must_equal 24
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
it 'returns itself (mutable version only)' do
|
|
80
|
-
hash = {}
|
|
81
|
-
same_hash = hash.transform! Hash.new
|
|
82
|
-
|
|
83
|
-
same_hash.object_id.must_equal hash.object_id
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
end
|
|
87
|
-
end
|