Class: Availabiliter::AvailabilitiesCalculator

Inherits:
Object
  • Object
show all
Defined in:
lib/availabiliter/availabilities_calculator.rb

Overview

Centralize and orchestrate all behavior for availabilities calculations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_time_slots, minimum_availability_start:, maximum_availability_end:, format:, time_zone:) ⇒ AvailabilitiesCalculator

Returns a new instance of AvailabilitiesCalculator.



10
11
12
13
14
15
16
# File 'lib/availabiliter/availabilities_calculator.rb', line 10

def initialize(raw_time_slots, minimum_availability_start:, maximum_availability_end:, format:, time_zone:)
  @raw_time_slots = raw_time_slots
  @minimum_availability_start = minimum_availability_start
  @maximum_availability_end = maximum_availability_end
  @format = format
  @time_zone = time_zone
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



8
9
10
# File 'lib/availabiliter/availabilities_calculator.rb', line 8

def format
  @format
end

#maximum_availability_endObject (readonly)

Returns the value of attribute maximum_availability_end.



8
9
10
# File 'lib/availabiliter/availabilities_calculator.rb', line 8

def maximum_availability_end
  @maximum_availability_end
end

#minimum_availability_startObject (readonly)

Returns the value of attribute minimum_availability_start.



8
9
10
# File 'lib/availabiliter/availabilities_calculator.rb', line 8

def minimum_availability_start
  @minimum_availability_start
end

#raw_time_slotsObject (readonly)

Returns the value of attribute raw_time_slots.



8
9
10
# File 'lib/availabiliter/availabilities_calculator.rb', line 8

def raw_time_slots
  @raw_time_slots
end

#time_zoneObject (readonly)

Returns the value of attribute time_zone.



8
9
10
# File 'lib/availabiliter/availabilities_calculator.rb', line 8

def time_zone
  @time_zone
end

Instance Method Details

#callObject



18
19
20
# File 'lib/availabiliter/availabilities_calculator.rb', line 18

def call
  output_availabilities
end