Class: Hcp::Job::Appointment

Inherits:
Resource show all
Defined in:
lib/hcp/resources/job/appointment.rb

Overview

One visit a job is booked for, where the work takes more than a single trip.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

amount, attribute, #id, #initialize, timestamp

Constructor Details

This class inherits a constructor from Hcp::Resource

Class Method Details

.keyObject

What Housecall Pro calls a list of them.



5
# File 'lib/hcp/resources/job/appointment.rb', line 5

def self.key = 'appointments'

Instance Method Details

#anytime?Boolean

Returns whether the visit is booked for a day rather than for a time.

Returns:

  • (Boolean)

    whether the visit is booked for a day rather than for a time.



17
# File 'lib/hcp/resources/job/appointment.rb', line 17

def anytime? = @node['anytime']

#arrival_windowInteger, ...

Returns:

  • (Integer, nil)

    how many minutes wide the arrival window is.

  • (String, nil)

    the arrival_window, as Housecall Pro answers it.



14
# File 'lib/hcp/resources/job/appointment.rb', line 14

attribute :arrival_window, :arrival_window_minutes

#dispatched_employee_idsArray<String>

Returns the IDs of the pros sent on the visit.

Returns:

  • (Array<String>)

    the IDs of the pros sent on the visit.



20
# File 'lib/hcp/resources/job/appointment.rb', line 20

def dispatched_employee_ids = Array(@node['dispatched_employees_ids'])

#ends_atTime?

Returns:

  • (Time, nil)

    when the visit is booked to end.

  • (Time, nil)

    the moment Housecall Pro answers as ends_at.



11
# File 'lib/hcp/resources/job/appointment.rb', line 11

timestamp :ends_at, :end_time

#starts_atTime?

Returns:

  • (Time, nil)

    when the visit is booked to start.

  • (Time, nil)

    the moment Housecall Pro answers as starts_at.



8
# File 'lib/hcp/resources/job/appointment.rb', line 8

timestamp :starts_at, :start_time