hash_map_hash 1.0.2 → 1.0.3
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 +4 -4
- data/lib/hash_map_hash.rb +2 -8
- 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: 480f59b8785254db66b8bc4690db384d18aabead
|
4
|
+
data.tar.gz: 6c0151ca812c3fa924ffc2f6e312479d31992d63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 829221d82a46b296a5ced38449f5250f766035067f85bc1e5ec3a231829ee19a14108efdda83ebfb96d5662ea3655960079368e751d4e9ee602431b2a80a9e17
|
7
|
+
data.tar.gz: 12603209c771a9ea2c673571ba44022c88608ae1680a943321819cb1485807e54dce695175dd275ad4e7ba0ddbbf4ba58e843645a4a5c9cdbcced4df7f327a34
|
data/lib/hash_map_hash.rb
CHANGED
@@ -1,14 +1,8 @@
|
|
1
1
|
class HashMapHash
|
2
|
-
module DeepDup
|
3
|
-
def deep_dup
|
4
|
-
Marshal.load(Marshal.dump(self))
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
2
|
attr_reader :mapping
|
9
3
|
|
10
4
|
def initialize(mapping)
|
11
|
-
@mapping = mapping
|
5
|
+
@mapping = mapping
|
12
6
|
end
|
13
7
|
|
14
8
|
# Data sample (source_data)
|
@@ -50,7 +44,7 @@ class HashMapHash
|
|
50
44
|
# summ: 123.45
|
51
45
|
# }
|
52
46
|
def map(source_data)
|
53
|
-
mapping.
|
47
|
+
mapping.dup.each_with_object({}) do |(attribute_key, attribute_mapping), result|
|
54
48
|
result[attribute_key] = filtered_deep_fetch source_data, Array(attribute_mapping)
|
55
49
|
end
|
56
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hash_map_hash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Peplin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -31,7 +31,7 @@ extensions: []
|
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
33
|
- lib/hash_map_hash.rb
|
34
|
-
homepage: http://github.com/
|
34
|
+
homepage: http://github.com/7Pikes/hash_map_hash
|
35
35
|
licenses:
|
36
36
|
- MIT
|
37
37
|
metadata: {}
|