looksist 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/looksist/hashed.rb +4 -4
- data/lib/looksist/version.rb +1 -1
- data/lib/looksist.rb +0 -2
- data/spec/looksist/hashed_spec.rb +1 -2
- 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: 8526c6730f1f78436abccf895c6b9c66afdf0d40
|
4
|
+
data.tar.gz: 49abb35ed9f3dfdf904694b25be5c48d21537e5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b15b2d989a8a5f0a71292112e5eb0abfbb120f277b6e15f0b1d38545b3c2d17e3f1583ea8985b18aba42d8f728410c5166ee2b074c1cf21d561c0f1d64ee946
|
7
|
+
data.tar.gz: 541a9d243b0d3f9b1721020e5d91e8650562fe10f9774f0d7ba0bd2270d93f55458374c75c194679eedfd55a76702d0eb2eb080cbac8fe5f69d073b890ae6ba1
|
data/lib/looksist/hashed.rb
CHANGED
@@ -52,11 +52,11 @@ module Looksist
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def inject_attributes_for(arry_of_hashes, opts)
|
55
|
+
entity_name = entity(opts[:using])
|
56
|
+
keys = (arry_of_hashes.collect { |i| i[opts[:using]] }).compact.uniq
|
57
|
+
values = keys.zip(Looksist.redis_service.send("#{entity_name}_for", keys)).to_h
|
55
58
|
arry_of_hashes.each do |elt|
|
56
|
-
|
57
|
-
entity_name = entity(opts[:using])
|
58
|
-
value = Looksist.redis_service.send("#{entity_name}_for", [key])
|
59
|
-
elt[opts[:populate]] = value.first
|
59
|
+
elt[opts[:populate]] = values[elt[opts[:using]]]
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
data/lib/looksist/version.rb
CHANGED
data/lib/looksist.rb
CHANGED
@@ -33,8 +33,7 @@ describe Looksist::Hashed do
|
|
33
33
|
inject after: :metrics, at: '$.table.menu', using: :item_id, populate: :item_name
|
34
34
|
end
|
35
35
|
|
36
|
-
expect(@mock).to receive(:mget).with(
|
37
|
-
expect(@mock).to receive(:mget).with(*['items/2']).and_return(['Pongal'])
|
36
|
+
expect(@mock).to receive(:mget).once.with(*%w(items/1 items/2)).and_return(%w(Idly Pongal))
|
38
37
|
|
39
38
|
expect(Menu.new.metrics).to eq({
|
40
39
|
table: {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: looksist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RC
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|