Class: MyTime::TimeProcesser
- Inherits:
-
Object
- Object
- MyTime::TimeProcesser
- Includes:
- Tags
- Defined in:
- lib/docfolio/paragraph.rb
Overview
processes new times and dates with current times and dates
Constant Summary
Constants included from Tags
Tags::ALL_TAGS, Tags::CREDITABLE, Tags::SECTIONS, Tags::SPECIAL, Tags::TAGS
Instance Method Summary collapse
-
#process_times(new_times, current_times_and_dates) ⇒ Array
Takes class start end times and dates as Time objects and amends the times, advancing the date if the start time has crossed midnight.
Methods included from Tags
#extract_date, #extract_tags, #extract_time_object
Instance Method Details
#process_times(new_times, current_times_and_dates) ⇒ Array
Takes class start end times and dates as Time objects and amends the times, advancing the date if the start time has crossed midnight.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/docfolio/paragraph.rb', line 20 def process_times(new_times, current_times_and_dates) @start_time, @end_time, @date = current_times_and_dates f_hour, f_min, t_hour, t_min = new_times if (has f_hour) && to_st_tme(f_hour, f_min) t_hour = f_hour t_min = f_min end to_end_time(t_hour, t_min) if has t_hour [@start_time, @end_time, @date] end |