refocus 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/refocus/samples.rb +3 -7
- data/lib/refocus/samples/collector.rb +12 -2
- data/lib/refocus/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: dfa3fd9edd1de4e2d5213bd44acec770c6b5c04a
|
4
|
+
data.tar.gz: 9394b3b76f77e7fd161ce5f2d937de7eeb096ace
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec906b338fad8a6290cc4364fd92aa4e2d6d2b3aaa065bb0a2e90b6be3e52fec6545922912d9b78139c909d168e72575bd67e564c0770c8102bdeaf074a005cc
|
7
|
+
data.tar.gz: e807771762aaa699e87ee0b2a07900c1718465739e26be016dd9bfbb129671f1ea2157d2f8491e1276bb6cdb4899ffd4da786ff9b3b7f3720ac68f5089c9c809
|
data/Gemfile.lock
CHANGED
data/lib/refocus/samples.rb
CHANGED
@@ -16,8 +16,9 @@ module Refocus
|
|
16
16
|
Collector.new(http: http)
|
17
17
|
end
|
18
18
|
|
19
|
-
def upsert(name:, aspect:, value:
|
20
|
-
sample = format_sample(name:name, aspect: aspect, value: value,
|
19
|
+
def upsert(name:, aspect:, value:nil, message_body:nil, message_code:nil, related_links:nil)
|
20
|
+
sample = format_sample(name:name, aspect: aspect, value: value, message_body: message_body,
|
21
|
+
message_code: message_code, related_links: related_links)
|
21
22
|
json(http.post("upsert", body: sample, expects: 200))
|
22
23
|
end
|
23
24
|
alias_method :submit, :upsert
|
@@ -37,10 +38,5 @@ module Refocus
|
|
37
38
|
json(http.get(URI.escape("#{subject}\|#{aspect}")))
|
38
39
|
end
|
39
40
|
|
40
|
-
private
|
41
|
-
def format_sample(name:, aspect:, value:"", messageBody:"", messageCode:"", relatedLinks:[])
|
42
|
-
{name: "#{name}|#{aspect}", value: value.to_s, messageBody: messageBody, messageCode: messageCode, relatedLinks: relatedLinks}
|
43
|
-
end
|
44
|
-
|
45
41
|
end
|
46
42
|
end
|
@@ -12,8 +12,9 @@ module Refocus
|
|
12
12
|
@samples = []
|
13
13
|
end
|
14
14
|
|
15
|
-
def add(name:, aspect:, value:
|
16
|
-
samples <<
|
15
|
+
def add(name:, aspect:, value:nil, message_body:nil, message_code:nil, related_links:nil)
|
16
|
+
samples << format_sample(name:name, aspect: aspect, value: value, message_body: message_body,
|
17
|
+
message_code: message_code, related_links: related_links)
|
17
18
|
end
|
18
19
|
|
19
20
|
def upsert_bulk
|
@@ -23,6 +24,15 @@ module Refocus
|
|
23
24
|
end
|
24
25
|
alias_method :submit, :upsert_bulk
|
25
26
|
|
27
|
+
def format_sample(name:, aspect:, value:nil, message_body:nil, message_code:nil, related_links:nil)
|
28
|
+
sample = {name: "#{name}|#{aspect}"}
|
29
|
+
sample[:value] = value.to_s if value
|
30
|
+
sample[:messageBody] = message_body.to_s if message_body
|
31
|
+
sample[:messageCode] = message_code.to_s if message_code
|
32
|
+
sample[:relatedLinks] = related_links if related_links
|
33
|
+
sample
|
34
|
+
end
|
35
|
+
|
26
36
|
end
|
27
37
|
end
|
28
38
|
end
|
data/lib/refocus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refocus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Shea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|