Class: Antaeus::Resources::Guest
Instance Attribute Summary
#client, #errors
Instance Method Summary
collapse
#<=>, all, delayed_property, #destroy, #fresh?, gen_property_methods, get, human, i18n_key, #id, immutable, #immutable?, immutable?, #initialize, #model_name, #new?, param_key, path, path_for, #path_for, paths, #paths, #persisted?, properties, property, #reload, route_key, #save, search, singular_route_key, #tainted?, #to_key, #to_model, #to_param, #update, where
Instance Method Details
#appointments ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/antaeus-sdk/resources/guest.rb', line 17
def appointments
ResourceCollection.new(
@client.get("#{path_for(:all)}/#{id}/appointments")['appointments'].collect do |record|
Appointment.new(
entity: record,
lazy: true,
tainted: false,
client: @client
)
end,
type: Antaeus::Resources::Appointment,
client: @client
)
end
|
#available_appointments(location) ⇒ Object
32
33
34
|
# File 'lib/antaeus-sdk/resources/guest.rb', line 32
def available_appointments(location)
upcoming_appointments.where(location: location)
end
|
#upcoming_appointments ⇒ Object
36
37
38
|
# File 'lib/antaeus-sdk/resources/guest.rb', line 36
def upcoming_appointments
Appointment.upcoming(client: client).where(:guest_id, id)
end
|