Class: Hcp::Schedule

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

Overview

When work is booked for, and how long a window the customer was given.

Instance Method Summary collapse

Methods inherited from Resource

amount, attribute, #id, #initialize, timestamp

Constructor Details

This class inherits a constructor from Hcp::Resource

Instance Method Details

#appointmentsArray<Job::Appointment>

Housecall Pro leaves these out unless a list was asked to bring them back, so a job read without includes(:appointments) has none of them rather than none at all.

Returns:



19
# File 'lib/hcp/resources/schedule.rb', line 19

def appointments = records Job::Appointment, 'appointments'

#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/schedule.rb', line 14

attribute :arrival_window

#ends_atTime?

Returns:

  • (Time, nil)

    when the work is booked to end.

  • (Time, nil)

    the moment Housecall Pro answers as ends_at.



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

timestamp :ends_at, :scheduled_end

#starts_atTime?

Returns:

  • (Time, nil)

    when the work is booked to start.

  • (Time, nil)

    the moment Housecall Pro answers as starts_at.



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

timestamp :starts_at, :scheduled_start

#time_zoneString?

Returns:

  • (String, nil)

    the IANA zone to show a customer a time in.

  • (String, nil)

    the time_zone, as Housecall Pro answers it.



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

attribute :time_zone