Class: Luma::AppointmentType

Inherits:
Connection show all
Defined in:
lib/luma/appointment_type.rb

Constant Summary collapse

APPOINTMENT_TYPE_ENDPOINT =
'/api/appointmentTypes'.freeze

Constants inherited from Connection

Connection::DEFAULT_ENDPOINT

Instance Method Summary collapse

Methods inherited from Connection

#add_header, #initialize, #luma_request, #request

Constructor Details

This class inherits a constructor from Luma::Connection

Instance Method Details

#create_appointment_type(endpoint: APPOINTMENT_TYPE_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post, debug_output: $stdout) ⇒ Object



16
17
18
# File 'lib/luma/appointment_type.rb', line 16

def create_appointment_type(endpoint: APPOINTMENT_TYPE_ENDPOINT, body: nil, headers: {}, auth: true, verb: :post, debug_output: $stdout)
  luma_request(auth: auth, body: body, endpoint: endpoint, verb: verb)
end

#view_appointment_types(endpoint: APPOINTMENT_TYPE_ENDPOINT, auth: true, name: nil, description: nil, debug_output: $stdout) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/luma/appointment_type.rb', line 7

def view_appointment_types(endpoint: APPOINTMENT_TYPE_ENDPOINT, auth: true, name: nil, description: nil, debug_output: $stdout)
  self.add_header if auth

  url = "api/appointmentTypes?name=#{name}&description=#{description}"
  full_url = "https://api.lumahealth.io/" + url

  HTTParty.get(full_url.to_str, headers: @headers, debug_output: $stdout)
end