Class: Updox::Models::Appointment
Constant Summary
collapse
- SYNC_ENDPOINT =
'/AppointmentsSync'.freeze
- SYNC_LIST_TYPE =
'appointments'.freeze
Extensions::Sync::RECOMMENDED_BATCH_SIZE
Constants inherited
from Model
Model::ITEM_TYPE, Model::LIST_NAME, Model::LIST_TYPE
Class Method Summary
collapse
Instance Method Summary
collapse
sync
Methods inherited from Model
#error_message, from_response, request, #response_code, #response_message, #successful?
Class Method Details
.exists?(appointment_id, account_id:, cached_query: nil) ⇒ Boolean
48
49
50
|
# File 'lib/updox/models/appointment.rb', line 48
def self.exists?(appointment_id, account_id: , cached_query: nil)
Updox::Models::AppointmentStatus.exists?(appointment_id, account_id: account_id, cached_query: cached_query)
end
|
Instance Method Details
#as_json(args) ⇒ Object
40
41
42
|
# File 'lib/updox/models/appointment.rb', line 40
def as_json(args)
self.to_h
end
|
#save(account_id:) ⇒ Object
44
45
46
|
# File 'lib/updox/models/appointment.rb', line 44
def save(account_id: )
self.class.sync([self], account_id: account_id)
end
|
#to_h ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/updox/models/appointment.rb', line 32
def to_h
result = super.to_h
result['date'] = result['date'].strftime(Updox::Models::DATETIME_FORMAT) if result['date'].respond_to?(:strftime)
result
end
|