Class: Provider

Inherits:
User
  • Object
show all
Defined in:
app/models/provider.rb

Overview

The service Provider that creates Slots which the Customers can book.

Instance Attribute Summary (collapse)

Attributes inherited from User

#email, #name, #password_digest, #state

Instance Method Summary (collapse)

Methods inherited from User

login, #signup

Instance Attribute Details

- (Array<Affiliation>) affiliations

Returns the Affiliations for that given Provider.

Returns:



14
15
16
# File 'app/models/provider.rb', line 14

def affiliations
  @affiliations
end

- (Business) business

Returns the Business associated with that Provider.

Returns:



8
9
10
# File 'app/models/provider.rb', line 8

def business
  @business
end

- (ProviderPrivacyConfiguration) privacy_configuration

Returns the privacy configuration for the Provider.

Returns:



5
6
7
# File 'app/models/provider.rb', line 5

def privacy_configuration
  @privacy_configuration
end

- (Array<Slot>) slots

Returns the Slots for that given Provider.

Returns:



11
12
13
# File 'app/models/provider.rb', line 11

def slots
  @slots
end

Instance Method Details

- (Slot) create_free(slot)

Create a free Slot for Customers to book.

If the Slot conflicts with an already existing Slot in the Provider agenda, fail.

Parameters:

Returns:



23
24
# File 'app/models/provider.rb', line 23

def create_free slot
end

- (Booking) reserve(slot, customer)

Create a Slot and book it for the Customer.

If the Slot conflicts with an already existing Slot in either the Provider or the Customer agenda, fail.

Parameters:

Returns:



35
36
# File 'app/models/provider.rb', line 35

def reserve slot, customer
end