luma 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/luma/connection.rb +26 -0
- data/lib/luma/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b6c41b33c30376d3547ffc627ff104117b7fc7de37065b8b37a64fdcd2e06a2
|
4
|
+
data.tar.gz: 2c1c28940256c86f2183b60b6687e24c55145e6dc07ac65993004264ab4ab59c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec9bd186cb7e88d500950a3ad83cf7cebd142501d8d2fc7f9152fb30c14c75d6c12e24a7f23a8d29f6d930db65569c657c26ab01eea3ee2ce36c1ac9d41c2f6e
|
7
|
+
data.tar.gz: b5d8502b97b32c0be12872ca6fa2b91097a2f42e13e64928f443865d4056d95421f019083e554796c22ee2823e87101bc959b97507e044b1a41ad47480d582a4
|
data/lib/luma/connection.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Luma
|
2
2
|
class Connection
|
3
3
|
DEFAULT_ENDPOINT = '/endpoint'.freeze
|
4
|
+
APPOINTMENT_TYPE_ENDPOINT = '/api/appointmentTypes'.freeze
|
4
5
|
|
5
6
|
include HTTParty
|
6
7
|
|
@@ -17,6 +18,31 @@ module Luma
|
|
17
18
|
self.class.send("#{verb}", endpoint, body: body, headers: headers)
|
18
19
|
end
|
19
20
|
|
21
|
+
def view_appointment_types(endpoint: APPOINTMENT_TYPE_ENDPOINT, body: nil, headers: {}, auth: true, name: nil, description: nil)
|
22
|
+
if auth
|
23
|
+
body = body.to_json
|
24
|
+
headers = auth_header.merge(headers)
|
25
|
+
headers["Content-Type"] = 'application/json'
|
26
|
+
end
|
27
|
+
|
28
|
+
url = "api/appointmentTypes?name=#{name}&description=#{description}"
|
29
|
+
full_url = "https://api.lumahealth.io/" + url
|
30
|
+
|
31
|
+
result = HTTParty.get(full_url.to_str, body: nil, headers: headers, debug_output: $stdout)
|
32
|
+
{ result: result, headers: headers }
|
33
|
+
end
|
34
|
+
|
35
|
+
def create_appointment_type(endpoint: APPOINTMENT_TYPE_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post)
|
36
|
+
if auth
|
37
|
+
body = body.to_json
|
38
|
+
headers = auth_header.merge(headers)
|
39
|
+
headers["Content-Type"] = 'application/json'
|
40
|
+
end
|
41
|
+
|
42
|
+
result = self.class.send(verb.to_s, endpoint, body: body, headers: headers, debug_output: $stdout)
|
43
|
+
{ result: result, headers: headers }
|
44
|
+
end
|
45
|
+
|
20
46
|
private
|
21
47
|
|
22
48
|
def auth_header
|
data/lib/luma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Angela Rodriguez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|