Class: LWS::Presence::Location

Inherits:
Generic::Model show all
Defined in:
lib/lws/apps/presence.rb

Overview

The location class

Defined Under Namespace

Classes: Map

Instance Attribute Summary collapse

Attributes inherited from Generic::Model

#created_at, #id, #updated_at, #url, #url_html

Method Summary

Methods inherited from Generic::Model

#deep_dup, #dig, #reload, #rollback, #save

Instance Attribute Details

#ancestor_idsArray<Integer>

Returns the ID of the locations that containt the location, including the location itself.

Returns:

  • (Array<Integer>)

    the ID of the locations that containt the location, including the location itself



137
# File 'lib/lws/apps/presence.rb', line 137

attribute :ancestor_ids

#appointmentsArray<Appointment>

Returns the appointments taking place at the location.

Returns:

  • (Array<Appointment>)

    the appointments taking place at the location



141
# File 'lib/lws/apps/presence.rb', line 141

has_many :appointments

#capacityInteger

Returns the capacity (maximum number of people) of the location.

Returns:

  • (Integer)

    the capacity (maximum number of people) of the location



145
# File 'lib/lws/apps/presence.rb', line 145

attribute :capacity

#capacity_treeInteger

Returns the capacity (maximum number of people) of the location including descendant locations.

Returns:

  • (Integer)

    the capacity (maximum number of people) of the location including descendant locations



150
# File 'lib/lws/apps/presence.rb', line 150

attribute :capacity_tree

#capacity_usedInteger

Returns the used capacity (present number of people) of the location.

Returns:

  • (Integer)

    the used capacity (present number of people) of the location



154
# File 'lib/lws/apps/presence.rb', line 154

attribute :capacity_used

#capacity_used_percentageFloat

Returns the used capacity percentage of the location.

Returns:

  • (Float)

    the used capacity percentage of the location



163
# File 'lib/lws/apps/presence.rb', line 163

attribute :capacity_used_precentage

#capacity_used_percentage_treeFloat

Returns the used capacity percentage of the location including descendant locations.

Returns:

  • (Float)

    the used capacity percentage of the location including descendant locations



168
# File 'lib/lws/apps/presence.rb', line 168

attribute :capacity_used_precentage_tree

#capacity_used_treeInteger

Returns the used capacity (present number of people) of the location including descendant locations.

Returns:

  • (Integer)

    the used capacity (present number of people) of the location including descendant locations



159
# File 'lib/lws/apps/presence.rb', line 159

attribute :capacity_used_tree

#checkin_status"available", ...

Returns the presence status to set people to when checking in.

Returns:

  • ("available", "busy", "away", nil)

    the presence status to set people to when checking in



173
# File 'lib/lws/apps/presence.rb', line 173

attribute :checkin_status

#checkout_alter_status"available", ...

Returns the status to set the location to when someone checks out.

Returns:

  • ("available", "maintenance_cleaning", "maintenance_technical", "reserved", "unavailable", "permanent_available", "permanent_maintenance_cleaning", "permanent_maintenance_technical", "permanent_reserved", "permanent_unavailable", nil)

    the status to set the location to when someone checks out



181
# File 'lib/lws/apps/presence.rb', line 181

attribute :checkout_alter_status

#checkout_locationLocation?

Returns the location to move people to when they are checked out.

Returns:

  • (Location, nil)

    the location to move people to when they are checked out



186
187
188
# File 'lib/lws/apps/presence.rb', line 186

belongs_to :checkout_location, class_name: "LWS::Presence::Location",
foreign_key: "checkout_location_id",
uri: "locations/:id"

#checkout_location_idInteger?

Returns the ID of the location to move people to when they are checked out.

Returns:

  • (Integer, nil)

    the ID of the location to move people to when they are checked out



193
# File 'lib/lws/apps/presence.rb', line 193

attribute :checkout_location_id

#companyLWS::Auth::Company

Returns the company the location belongs to.

Returns:



197
# File 'lib/lws/apps/presence.rb', line 197

belongs_to :company, class_name: "LWS::Auth::Company"

#company_idInteger

Returns the ID of the company the location belongs to.

Returns:

  • (Integer)

    the ID of the company the location belongs to



201
# File 'lib/lws/apps/presence.rb', line 201

attribute :company_id

#descendant_idsArray<Integer>

Returns the IDs of the underlying locations of the location.

Returns:

  • (Array<Integer>)

    the IDs of the underlying locations of the location



205
# File 'lib/lws/apps/presence.rb', line 205

attribute :descendant_ids

#image_storage_idString?

Returns the storage ID of the image of the location.

Returns:

  • (String, nil)

    the storage ID of the image of the location



209
# File 'lib/lws/apps/presence.rb', line 209

attribute :image_storage_id

#image_urlString?

Note:

To be able retrieve this, the token needs to be passed via X-Token in the HTTP request headers!

Returns the URL of the image of the location.

Returns:

  • (String, nil)

    the URL of the image of the location



216
# File 'lib/lws/apps/presence.rb', line 216

attribute :image_url

#import_refString?

Returns reference of the location in the remote database.

Returns:

  • (String, nil)

    reference of the location in the remote database



220
# File 'lib/lws/apps/presence.rb', line 220

attribute :import_ref

#journalsArray<Journal>

Returns the journal (entries) associated with the location.

Returns:

  • (Array<Journal>)

    the journal (entries) associated with the location



224
# File 'lib/lws/apps/presence.rb', line 224

has_many :journals, class: "LWS::Presence::Journal"

#latFloat

Returns the latitude of the location.

Returns:

  • (Float)

    the latitude of the location



228
# File 'lib/lws/apps/presence.rb', line 228

attribute :lat

#logoff_timeString

The format of the time is HH:MM and should be interpreted in the time zone of the location (see also #time_zone).

Returns:

  • (String)

    the time everybody is automatically logged off



234
# File 'lib/lws/apps/presence.rb', line 234

attribute :logoff_time

#longFloat

Returns the longitude of the location.

Returns:

  • (Float)

    the longitude of the location



238
# File 'lib/lws/apps/presence.rb', line 238

attribute :long

#map_positionsArray<Location::Map::Position>

Returns the location map positions that track this location.

Returns:



243
# File 'lib/lws/apps/presence.rb', line 243

has_many :map_positions, class_name: "LWS::Presence::Location::Map::Position"

#mapsArray<Location::Map>

Returns the maps for this location.

Returns:



247
# File 'lib/lws/apps/presence.rb', line 247

has_many :maps, class_name: "LWS::Presence::Location::Map"

#nameString

Returns the name of the location.

Returns:

  • (String)

    the name of the location



251
# File 'lib/lws/apps/presence.rb', line 251

attribute :name

#ownerPerson?

Returns the owner of the location.

Returns:

  • (Person, nil)

    the owner of the location



255
256
257
# File 'lib/lws/apps/presence.rb', line 255

belongs_to :owner, class_name: "LWS::Presence::Person",
foreign_key: "owner_id",
uri: "people/:id"

#owner_idFixnum?

Returns the ID of the owner of the location.

Returns:

  • (Fixnum, nil)

    the ID of the owner of the location



261
# File 'lib/lws/apps/presence.rb', line 261

attribute :owner_id

#parentLocation

Returns the parent of the location.

Returns:

  • (Location)

    the parent of the location



265
266
267
# File 'lib/lws/apps/presence.rb', line 265

belongs_to :parent, class_name: "LWS::Presence::Location",
foreign_key: "parent_id",
uri: "locations/:id"

#parent_idInteger

Returns the ID of the parent of the location.

Returns:

  • (Integer)

    the ID of the parent of the location



271
# File 'lib/lws/apps/presence.rb', line 271

attribute :parent_id

#peopleArray<Person>

Returns the people associated with the location.

Returns:

  • (Array<Person>)

    the people associated with the location



275
# File 'lib/lws/apps/presence.rb', line 275

has_many :people

#people_treeArray<Person>

Returns the people associated with the location including descendant locations.

Returns:

  • (Array<Person>)

    the people associated with the location including descendant locations



280
# File 'lib/lws/apps/presence.rb', line 280

has_many :people_tree, class_name: "LWS::Presence::Person"

#rangeInteger

Returns the range around the location in meters.

Returns:

  • (Integer)

    the range around the location in meters



284
# File 'lib/lws/apps/presence.rb', line 284

attribute :range

#readersArray<Reader>

Returns the (RFID/code/ID/…) readers linked to this location.

Returns:

  • (Array<Reader>)

    the (RFID/code/ID/…) readers linked to this location



288
# File 'lib/lws/apps/presence.rb', line 288

has_many :readers

#status"available", ...

Returns the status of the location.

Returns:

  • ("available", "maintenance_cleaning", "maintenance_technical", "reserved", "unavailable", "permanent_available", "permanent_maintenance_cleaning", "permanent_maintenance_technical", "permanent_reserved", "permanent_unavailable")

    the status of the location



296
# File 'lib/lws/apps/presence.rb', line 296

attribute :status

#time_zoneString

Returns the time zone of the location.

Returns:

  • (String)

    the time zone of the location



300
# File 'lib/lws/apps/presence.rb', line 300

attribute :time_zone

#uuidString

Returns the UUID of the location.

Returns:

  • (String)

    the UUID of the location



304
# File 'lib/lws/apps/presence.rb', line 304

attribute :uuid