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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1f24dd0ab5dc2ecd74d97898186fe82e8707ed9
4
- data.tar.gz: 1dd166204586a4c8a68128a63416bf103c340a15
3
+ metadata.gz: dfa3fd9edd1de4e2d5213bd44acec770c6b5c04a
4
+ data.tar.gz: 9394b3b76f77e7fd161ce5f2d937de7eeb096ace
5
5
  SHA512:
6
- metadata.gz: f0a90d7e8409ba274a6565640474560559c2dad1a3e3546b5faf7a8c87d81d13911873786b76203f1f0cbf386c456c9c9fc6fc3e961b1ac0d10e6d7cb7f7375f
7
- data.tar.gz: 5e27257666076c2490379ca0ee1377413f90774ac96af4bab5bf9327122482600a2ed56fb319884eddb706fbd0e63dcda1c178fb924681e17a49bcfda8781632
6
+ metadata.gz: ec906b338fad8a6290cc4364fd92aa4e2d6d2b3aaa065bb0a2e90b6be3e52fec6545922912d9b78139c909d168e72575bd67e564c0770c8102bdeaf074a005cc
7
+ data.tar.gz: e807771762aaa699e87ee0b2a07900c1718465739e26be016dd9bfbb129671f1ea2157d2f8491e1276bb6cdb4899ffd4da786ff9b3b7f3720ac68f5089c9c809
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- refocus (0.1.6)
4
+ refocus (0.1.7)
5
5
  clamp (~> 1.1)
6
6
  excon (~> 0.60)
7
7
 
@@ -42,4 +42,4 @@ DEPENDENCIES
42
42
  rspec (~> 3.0)
43
43
 
44
44
  BUNDLED WITH
45
- 1.16.1
45
+ 1.16.2
@@ -16,8 +16,9 @@ module Refocus
16
16
  Collector.new(http: http)
17
17
  end
18
18
 
19
- def upsert(name:, aspect:, value:"", messageBody:"", messageCode:"", relatedLinks:[])
20
- sample = format_sample(name:name, aspect: aspect, value: value, messageBody: messageBody, messageCode: messageCode, relatedLinks: relatedLinks)
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:"", messageBody:"", messageCode:"", relatedLinks:[])
16
- samples << {name: "#{name}|#{aspect}", value: value.to_s, messageBody: messageBody, messageCode: messageCode, relatedLinks: relatedLinks}
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
@@ -1,3 +1,3 @@
1
1
  module Refocus
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
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.6
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-16 00:00:00.000000000 Z
11
+ date: 2018-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler