Class: Availability::Slot

Inherits:
Data
  • Object
show all
Defined in:
lib/availability/busy_period.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(starts_at:, ends_at:) ⇒ Slot

Returns a new instance of Slot.

Raises:

  • (ArgumentError)


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_atObject (readonly)

Returns the value of attribute ends_at

Returns:

  • (Object)

    the current value of ends_at



20
21
22
# File 'lib/availability/busy_period.rb', line 20

def ends_at
  @ends_at
end

#starts_atObject (readonly)

Returns the value of attribute starts_at

Returns:

  • (Object)

    the current value of starts_at



20
21
22
# File 'lib/availability/busy_period.rb', line 20

def starts_at
  @starts_at
end