Class: SocialFramework::ScheduleHelper::ScheduleStrategy
- Inherits:
-
Object
- Object
- SocialFramework::ScheduleHelper::ScheduleStrategy
- Defined in:
- app/helpers/social_framework/schedule_helper.rb
Overview
Define a Abstract Class to build slots to schedule
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(elements_factory, max_duration) ⇒ ScheduleStrategy
constructor
- Init the slots and users in Array ====== Params:
elements_factory StringRepresent the factory class name to buildmax_duration-
ActiveSupport::Durationused to define max finish day to build graph Returns Graph’s Instance.
- Init the slots and users in Array ====== Params:
-
#verify_availabilities(users, start_day, finish_day, start_hour, finish_hour, slots_size) ⇒ Object
- Build slots to verify availabilities ====== Params:
users Arrayusers to check disponibilitystart_dayDatestart day to get slotsfinish_dayDatefinish day to get slotsstart_hourTimestart hour at each day to get slotsfinish_hourTimefinish hour at each day to get slotsslots_size-
Integerslots size duration Returns NotImplementedError.
- Build slots to verify availabilities ====== Params:
Constructor Details
#initialize(elements_factory, max_duration) ⇒ ScheduleStrategy
Init the slots and users in Array
Params:
elements_factory-
StringRepresent the factory class name to build max_duration-
ActiveSupport::Durationused 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-
Arrayusers to check disponibility start_day-
Datestart day to get slots finish_day-
Datefinish day to get slots start_hour-
Timestart hour at each day to get slots finish_hour-
Timefinish hour at each day to get slots slots_size-
Integerslots 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 |