lifen 1.6.6 → 1.6.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: 5a5d353b0280bcda3ac56078d1c0e7b1796b4701
4
- data.tar.gz: 34c7bb73efdc89f5c5c0c2090f77e91ad2a54943
3
+ metadata.gz: 2ef7f0cd7300aab6ce5b30cabfc8bd2a11f1e6f7
4
+ data.tar.gz: 4605d9d608326d65ccfd759b5a8ec36a35fc9298
5
5
  SHA512:
6
- metadata.gz: 6cb8551fe23604c092d2bae30eca752d48e159b296e3be4189297d6386fc750a58058514e6260aa01cd5a665dea2265ca1786900d158c5553d9bf436e2b40914
7
- data.tar.gz: f879c8089bbde34f901297e2a387d241178a1be9ca1af4fbef861c91227b7e2a0a35ef696e75b92931e28ad6262e0e8789f7402f21005ea5c5d3c07a3da52054
6
+ metadata.gz: 160bb1480b9388ad9da7144588f3520ea7e336a7e8f701b371361544e0470fe1722ca4e5a19f3f518350d6cb6a359d557ec226678586e8cdb3be46a9b3d4637a
7
+ data.tar.gz: 8321d68e992844d939870638aaa3393c25adb7f853f37431398c6360add472aa0f4ee2edc1bb1db07c8a053098bd45443905784095550bbd92425979196ed5c6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 1.6.7
2
+ -----
3
+
4
+ - A channel cannot be used if invalid
5
+
1
6
  1.6.5
2
7
  -----
3
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lifen (1.6.6)
4
+ lifen (1.6.7)
5
5
  faraday (>= 0.9)
6
6
  inflecto
7
7
  virtus (>= 1.0)
@@ -71,4 +71,4 @@ DEPENDENCIES
71
71
  webmock (~> 1.24)
72
72
 
73
73
  BUNDLED WITH
74
- 1.13.7
74
+ 1.14.6
@@ -7,6 +7,8 @@ module Lifen
7
7
  attribute :value, String
8
8
 
9
9
  def fhir_payload(user)
10
+ raise Lifen::Error, "Invalid channel: an UUID is required" if !valid?
11
+
10
12
  {
11
13
  id: user.uuid,
12
14
  resourceType: "Practitioner",
@@ -18,6 +20,10 @@ module Lifen
18
20
  }
19
21
  end
20
22
 
23
+ def valid?
24
+ uuid and uuid.length != 0
25
+ end
26
+
21
27
  def self.from_json(json, type = nil)
22
28
  new(uuid: json["id"], type: type, value: json["value"] || "#{json["line"].join(", ")}, #{json["postalCode"]} #{json["city"]}")
23
29
  end
data/lib/lifen/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lifen
2
- VERSION = "1.6.6"
2
+ VERSION = "1.6.7"
3
3
  end
@@ -24,6 +24,18 @@ describe Lifen::Communication::Request do
24
24
  expect(request.uuid).to_not be_nil
25
25
  end
26
26
 
27
+ context 'invalid channel' do
28
+
29
+ let(:channel) { Lifen::Communication::Channel.new(uuid: nil) }
30
+
31
+ it 'raises an error' do
32
+ expect{
33
+ request.send
34
+ }.to raise_error Lifen::Error, "Invalid channel: an UUID is required"
35
+ end
36
+
37
+ end
38
+
27
39
  end
28
40
 
29
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lifen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.6
4
+ version: 1.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Etienne Depaulis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-13 00:00:00.000000000 Z
11
+ date: 2017-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler