Class: Company::Location

Inherits:
Resource show all
Defined in:
lib/company/resources/location.rb

Overview

Where work happens: one address the business drives to.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#id, #initialize, keys, node_keys

Constructor Details

This class inherits a constructor from Company::Resource

Class Method Details

.attributes ⇒ Object

What every location reads, by the vocabulary's names.



5
# File 'lib/company/resources/location.rb', line 5

def self.attributes = %i[id street city zip latitude longitude]

Instance Method Details

#city ⇒ String?

Returns town.

Returns:

  • (String, nil) —

    town.



11
# File 'lib/company/resources/location.rb', line 11

def city = attribute :city

#customer ⇒ Customer?

Returns whose place it is, where they came back beside the location.

Returns:

  • (Customer, nil) —

    whose place it is, where they came back beside the location.



23
# File 'lib/company/resources/location.rb', line 23

def customer = record Customer, :customer

#latitude ⇒ Numeric?

Returns how far north the place is.

Returns:

  • (Numeric, nil) —

    how far north the place is.



17
# File 'lib/company/resources/location.rb', line 17

def latitude = attribute :latitude

#longitude ⇒ Numeric?

Returns how far east the place is.

Returns:

  • (Numeric, nil) —

    how far east the place is.



20
# File 'lib/company/resources/location.rb', line 20

def longitude = attribute :longitude

#street ⇒ String?

Returns street, number included.

Returns:

  • (String, nil) —

    street, number included.



8
# File 'lib/company/resources/location.rb', line 8

def street = attribute :street

#zip ⇒ String?

Returns ZIP code.

Returns:

  • (String, nil) —

    ZIP code.



14
# File 'lib/company/resources/location.rb', line 14

def zip = attribute :zip