caren-api 0.5.16 → 0.5.17
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/caren-api.gemspec +2 -2
- data/lib/caren/base.rb +1 -1
- data/lib/caren/care_provider.rb +4 -0
- data/lib/caren/link.rb +10 -1
- data/spec/care_provider_spec.rb +1 -1
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.17
|
data/caren-api.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "caren-api"
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.17"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andre Foeken"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-05-10"
|
13
13
|
s.description = "You can use this gem as inspiration of the base of your connections with Caren."
|
14
14
|
s.email = "andre.foeken@nedap.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/caren/base.rb
CHANGED
@@ -99,7 +99,7 @@ class Caren::Base
|
|
99
99
|
def self.hash_from_image hash_or_path
|
100
100
|
return hash_or_path if hash_or_path.is_a?(Hash)
|
101
101
|
{ :name => File.basename(hash_or_path),
|
102
|
-
:content =>
|
102
|
+
:content => File.open(hash_or_path).read,
|
103
103
|
:content_type => `file -b --mime-type #{hash_or_path}`.gsub(/\n/,"").split(";")[0] }
|
104
104
|
end
|
105
105
|
|
data/lib/caren/care_provider.rb
CHANGED
@@ -18,6 +18,7 @@ class Caren::CareProvider < Caren::Base
|
|
18
18
|
:bandwidth, # Integer (60 -> 60 minutes)
|
19
19
|
:show_employee_names, # Boolean
|
20
20
|
:show_employee_photos, # Boolean
|
21
|
+
:employee_name_display_type, # Integer (0 => Full name, 1 => Criminal name, 2 => First name)
|
21
22
|
:max_start, # String (23:00)
|
22
23
|
:min_start, # String (07:00)
|
23
24
|
:show_employee_name_as_title, # Boolean
|
@@ -25,6 +26,7 @@ class Caren::CareProvider < Caren::Base
|
|
25
26
|
:selective_communication, # Boolean
|
26
27
|
:api_key, # String, RSA public key
|
27
28
|
:linkable, # Boolean
|
29
|
+
:hidden, # Boolean
|
28
30
|
:closed_beta, # Boolean
|
29
31
|
:locale, # String
|
30
32
|
:lat,
|
@@ -64,6 +66,8 @@ class Caren::CareProvider < Caren::Base
|
|
64
66
|
:bandwidth => self.bandwidth,
|
65
67
|
:min_start => self.min_start,
|
66
68
|
:max_start => self.max_start,
|
69
|
+
:hidden => self.hidden,
|
70
|
+
:employee_name_display_type => self.employee_name_display_type,
|
67
71
|
:show_employee_name_as_title => self.show_employee_name_as_title,
|
68
72
|
:show_employee_names => self.show_employee_names,
|
69
73
|
:show_employee_photos => self.show_employee_photos,
|
data/lib/caren/link.rb
CHANGED
@@ -8,7 +8,8 @@ class Caren::Link < Caren::Base
|
|
8
8
|
:person_photo, # String (url of photo)
|
9
9
|
:patient_number, # String (12345)
|
10
10
|
:external_id, # String (Your person id)
|
11
|
-
:status
|
11
|
+
:status, # String (pending,confirmed,cancelled)
|
12
|
+
:skip_letter # Boolean
|
12
13
|
] + super
|
13
14
|
end
|
14
15
|
|
@@ -19,6 +20,10 @@ class Caren::Link < Caren::Base
|
|
19
20
|
def self.find id, session
|
20
21
|
from_xml session.get(self.resource_url(id))
|
21
22
|
end
|
23
|
+
|
24
|
+
def pdf
|
25
|
+
from_xml session.get(self.pdf_url(self.id))
|
26
|
+
end
|
22
27
|
|
23
28
|
def self.all session
|
24
29
|
from_xml session.get(self.resource_url)
|
@@ -43,6 +48,10 @@ class Caren::Link < Caren::Base
|
|
43
48
|
:link
|
44
49
|
end
|
45
50
|
|
51
|
+
def pdf_url id
|
52
|
+
"#{resource_location}/#{id}/pdf"
|
53
|
+
end
|
54
|
+
|
46
55
|
def self.resource_location
|
47
56
|
"/api/pro/links"
|
48
57
|
end
|
data/spec/care_provider_spec.rb
CHANGED
@@ -62,7 +62,7 @@ describe "CareProvider" do
|
|
62
62
|
logo = Caren::CareProvider.hash_from_image( filename )
|
63
63
|
logo[:content_type].should == "image/jpeg"
|
64
64
|
logo[:name].should == "bacon.jpg"
|
65
|
-
logo[:content].should ==
|
65
|
+
logo[:content].should == File.open(filename).read
|
66
66
|
end
|
67
67
|
|
68
68
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caren-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 41
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 17
|
10
|
+
version: 0.5.17
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andre Foeken
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-05-10 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
requirement: &id001 !ruby/object:Gem::Requirement
|