Module: Jbr::Properted

Included in:
Job, Visit
Defined in:
lib/jbr/properted.rb

Overview

Extends a record that stands at a property: a visit, a job, anything Jobber files somewhere.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.selection(client: false) ⇒ Object

What to ask for where a record names the place the work happens at.

Parameters:

  • client (Boolean) (defaults to: false)

    whether the place's own client comes back with it, which spares a second query for somebody Jobber already knows the place belongs to.



8
9
10
11
12
# File 'lib/jbr/properted.rb', line 8

def self.selection(client: false)
  [ 'property { id address {', Property::SELECTION, '}',
    (Cliental::SELECTION if client), '}',
  ].compact.join ' '
end

Instance Method Details

#propertyProperty

Returns where the work happens, and who Jobber holds the place for.

Returns:

  • (Property)

    where the work happens, and who Jobber holds the place for.



15
# File 'lib/jbr/properted.rb', line 15

def property = Property.new node: @node.fetch('property', {})