Class: Availabiliter
- Inherits:
-
Object
- Object
- Availabiliter
- Defined in:
- lib/availabiliter.rb,
lib/availabiliter/errors.rb,
lib/availabiliter/version.rb,
lib/availabiliter/time_slot.rb,
lib/availabiliter/input_formatter.rb,
lib/availabiliter/output_formatter.rb,
lib/availabiliter/options_validator.rb,
lib/availabiliter/time_slot_collection.rb,
lib/availabiliter/availabilities_calculator.rb
Overview
Availabilityer main class and namespace
Defined Under Namespace
Classes: AvailabilitiesCalculator, Error, IncorrectInput, InputFormatter, OptionsValidator, OutputFormatter, TimeSlot, TimeSlotCollection
Constant Summary collapse
- PROCESSABLE_FORMATS =
%i[time integer].freeze
- DEFAULT_FORMAT =
:integer
- PROCESSABLE_TIME_CLASSES =
[Date, Time, Integer, Float].freeze
- VERSION =
"1.1.1"
Class Method Summary collapse
Instance Method Summary collapse
- #calculate ⇒ Object
-
#initialize(raw_time_slots, options) ⇒ Availabiliter
constructor
A new instance of Availabiliter.
Constructor Details
#initialize(raw_time_slots, options) ⇒ Availabiliter
Returns a new instance of Availabiliter.
19 20 21 22 23 24 |
# File 'lib/availabiliter.rb', line 19 def initialize(raw_time_slots, ) @options = .merge() @raw_time_slots = raw_time_slots end |
Class Method Details
.call(raw_time_slots, **options) ⇒ Object
14 15 16 |
# File 'lib/availabiliter.rb', line 14 def call(raw_time_slots, **) new(raw_time_slots, ).calculate end |
Instance Method Details
#calculate ⇒ Object
26 27 28 |
# File 'lib/availabiliter.rb', line 26 def calculate AvailabilitiesCalculator.new(raw_time_slots, **).call end |