remi 0.2.38 → 0.2.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/remi/source_to_target_map/row.rb +8 -4
- data/lib/remi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc73b233d7181b3e40c96c5da2d52bf8d81d99a8
|
4
|
+
data.tar.gz: 536421bb23bf564eeb4394f3046467fe1dd9adf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08307536b89a25d60ddfdaad8595073b90e67e9094f22c709b3005abca6fec4bed5a838270579b4f81df1e803b8fba31c75f5ddb4bb1d263a3d5157006396d90
|
7
|
+
data.tar.gz: 344321318f9b76b95af19b8ff0c58d0c528da3bdeed6e15f6f60276513a2c24677cca360cc930d26087394a66082d5047b40706e0a87c8a4b9d5f20788e1ee64
|
data/Gemfile.lock
CHANGED
@@ -45,9 +45,8 @@ module Remi
|
|
45
45
|
# sources for a row transformation
|
46
46
|
def initialize(index, values, source_keys: nil)
|
47
47
|
@index = index
|
48
|
-
@inverted_index = index.invert
|
49
48
|
@values = values
|
50
|
-
@source_keys = source_keys
|
49
|
+
@source_keys = source_keys
|
51
50
|
end
|
52
51
|
|
53
52
|
# Public: Returns the value of the row array for the given key
|
@@ -62,15 +61,18 @@ module Remi
|
|
62
61
|
|
63
62
|
# Public: Makes Row enumerable, and acts like a hash.
|
64
63
|
def each &block
|
65
|
-
|
64
|
+
inverted_index = @index.invert
|
65
|
+
@values.each_with_index { |value, idx| block.call([inverted_index[idx], value]) }
|
66
66
|
end
|
67
67
|
|
68
|
+
# Public: Enumerates over each source value
|
68
69
|
def each_source &block
|
69
70
|
Enumerator.new do |y|
|
70
71
|
source_keys.each { |key| y << [key, self[key]] }
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
75
|
+
# Public: Enumerates over each target value
|
74
76
|
def each_target &block
|
75
77
|
Enumerator.new do |y|
|
76
78
|
target_keys.each { |key| y << [key, self[key]] }
|
@@ -87,10 +89,12 @@ module Remi
|
|
87
89
|
@index.keys
|
88
90
|
end
|
89
91
|
|
92
|
+
# Public: Returns all source keys
|
90
93
|
def source_keys
|
91
|
-
@source_keys
|
94
|
+
@source_keys ||= @index.keys
|
92
95
|
end
|
93
96
|
|
97
|
+
# Public: Returns all target keys
|
94
98
|
def target_keys
|
95
99
|
@target_keys ||= keys - source_keys
|
96
100
|
end
|
data/lib/remi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sterling Paramore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bond
|