Class: Availability::Slot
- Inherits:
-
Data
- Object
- Data
- Availability::Slot
- Defined in:
- lib/availability/busy_period.rb
Instance Attribute Summary collapse
-
#ends_at ⇒ Object
readonly
Returns the value of attribute ends_at.
-
#starts_at ⇒ Object
readonly
Returns the value of attribute starts_at.
Instance Method Summary collapse
-
#initialize(starts_at:, ends_at:) ⇒ Slot
constructor
A new instance of Slot.
Constructor Details
#initialize(starts_at:, ends_at:) ⇒ Slot
Returns a new instance of Slot.
23 24 25 26 27 |
# File 'lib/availability/busy_period.rb', line 23 def initialize(starts_at:, ends_at:) raise ArgumentError, 'slot end must be after start' unless ends_at > starts_at initialize_data(starts_at: starts_at.getutc.freeze, ends_at: ends_at.getutc.freeze) end |
Instance Attribute Details
#ends_at ⇒ Object (readonly)
Returns the value of attribute ends_at
20 21 22 |
# File 'lib/availability/busy_period.rb', line 20 def ends_at @ends_at end |
#starts_at ⇒ Object (readonly)
Returns the value of attribute starts_at
20 21 22 |
# File 'lib/availability/busy_period.rb', line 20 def starts_at @starts_at end |