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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90cb5a8a4e2004979fffe11787e075eadd846e0212772982ca8ecaf14c0dfa4b
4
- data.tar.gz: 0f984cb029cf220619d3e30410a352d24a8b56dfe7df1dc02fe6bec7f762d82d
3
+ metadata.gz: 9b6c41b33c30376d3547ffc627ff104117b7fc7de37065b8b37a64fdcd2e06a2
4
+ data.tar.gz: 2c1c28940256c86f2183b60b6687e24c55145e6dc07ac65993004264ab4ab59c
5
5
  SHA512:
6
- metadata.gz: 1323627f934c929039a9c00d4f006177fb8f90d76f1379889a339c57948f247d5f0dc23043c174513adb3a312fe6213059db03bbb8432c9e34389e6e70c1d74d
7
- data.tar.gz: 47853cccd286d61f368688cd8553b3fc6128b3b905a92791e63589174e92a09b82dc17282e63bc0a882bc8cc416b832753bfd7d2c919cfc4f44ef53b01962ec6
6
+ metadata.gz: ec9bd186cb7e88d500950a3ad83cf7cebd142501d8d2fc7f9152fb30c14c75d6c12e24a7f23a8d29f6d930db65569c657c26ab01eea3ee2ce36c1ac9d41c2f6e
7
+ data.tar.gz: b5d8502b97b32c0be12872ca6fa2b91097a2f42e13e64928f443865d4056d95421f019083e554796c22ee2823e87101bc959b97507e044b1a41ad47480d582a4
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Luma
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.0.2'.freeze
3
3
  end
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.1
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-06-02 00:00:00.000000000 Z
11
+ date: 2021-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty