Class: SocialFramework::ScheduleHelper::ScheduleStrategy

Inherits:
Object
  • Object
show all
Defined in:
app/helpers/social_framework/schedule_helper.rb

Overview

Define a Abstract Class to build slots to schedule

Direct Known Subclasses

ScheduleStrategyDefault

Instance Method Summary collapse

Constructor Details

#initialize(elements_factory, max_duration) ⇒ ScheduleStrategy

Init the slots and users in Array

Params:
elements_factory

String Represent the factory class name to build

max_duration

ActiveSupport::Duration used to define max finish day to build graph

Returns Graph’s Instance



13
14
15
16
17
# File 'app/helpers/social_framework/schedule_helper.rb', line 13

def initialize(elements_factory, max_duration)
  @elements_factory = elements_factory.new
  @slots = Array.new
  @max_duration = max_duration
end

Instance Method Details

#verify_availabilities(users, start_day, finish_day, start_hour, finish_hour, slots_size) ⇒ Object

Build slots to verify availabilities

Params:
users

Array users to check disponibility

start_day

Date start day to get slots

finish_day

Date finish day to get slots

start_hour

Time start hour at each day to get slots

finish_hour

Time finish hour at each day to get slots

slots_size

Integer slots size duration

Returns NotImplementedError



28
29
30
# File 'app/helpers/social_framework/schedule_helper.rb', line 28

def verify_availabilities(users, start_day, finish_day, start_hour, finish_hour, slots_size)
  raise 'Must implement method in subclass'
end