Class: FreeSlot
Overview
This represents a free slot.
The kind of Slot that the service Provider creates in order to Customers to book.
A FreeSlot does not stop existing after a Booking is associated with it in the same way a drawer does not stop being a drawer once we fill it with stuff.
Schema Information
Table name: slots
id :integer not null, primary key
capacity :integer default("1")
min_booking_length :integer default("15")
created_at :datetime not null
updated_at :datetime not null
slot_group_id :integer
color_id :integer not null
type :string not null
provider_id :integer
booking_state_id :integer
period_id :integer not null
affiliation_id :integer
free_slot_id :integer
Instance Method Summary (collapse)
- - (Boolean) full?
-
- (FreeSlot) initialize
constructor
A new instance of FreeSlot.
Methods inherited from Slot
Constructor Details
- (FreeSlot) initialize
Returns a new instance of FreeSlot
42 43 44 45 |
# File 'app/models/free_slot.rb', line 42 def initialize(*) super self.color ||= Color.green end |
Instance Method Details
- (Boolean) full?
47 48 49 |
# File 'app/models/free_slot.rb', line 47 def full? capacity <= bookings.size end |