Class: FreeSlot
Overview
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 :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.
Constructor Details
- (FreeSlot) initialize
Returns a new instance of FreeSlot
38 39 40 41 |
# File 'app/models/free_slot.rb', line 38 def initialize(*) super self.color ||= 0 end |
Instance Method Details
- (Boolean) full?
43 44 45 |
# File 'app/models/free_slot.rb', line 43 def full? capacity <= bookings.size end |