Class: Jbr::Visits

Inherits:
Resource show all
Includes:
Enumerable, Includable
Defined in:
lib/jbr/visits.rb

Overview

The visits on a Jobber account, oldest first, walked a page at a time.

Direct Known Subclasses

Mock::Visits

Constant Summary collapse

FIELDS =

What a visit answers with, before anything it was asked to bring back with it.

'id title startAt endAt allDay clientConfirmed job { id }'

Instance Attribute Summary

Attributes inherited from Resource

#id

Instance Method Summary collapse

Methods included from Includable

#includes

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Jbr::Resource

Instance Method Details

#eachObject

Every visit on the account, past and future alike. Nothing is read until the walk starts, and a page is read only once the one before it runs out.



11
# File 'lib/jbr/visits.rb', line 11

def each(&) = walk.each(&)

#pastEnumerator<Visit>

Returns the visits that started before now.

Returns:

  • (Enumerator<Visit>)

    the visits that started before now.



17
# File 'lib/jbr/visits.rb', line 17

def past = walk until_now

#upcomingEnumerator<Visit>

Returns the visits scheduled from now on.

Returns:

  • (Enumerator<Visit>)

    the visits scheduled from now on.



14
# File 'lib/jbr/visits.rb', line 14

def upcoming = walk from_now