Class: Times::TimeProcesser
- Inherits:
-
Object
- Object
- Times::TimeProcesser
- Defined in:
- lib/docfolio/paragraph_modules/times.rb
Overview
processes new times and dates with current times and dates
Class Attribute Summary collapse
-
.date ⇒ Object
Returns the value of attribute date.
-
.et ⇒ Object
Returns the value of attribute et.
-
.st ⇒ Object
Returns the value of attribute st.
Class Method Summary collapse
-
.reset ⇒ Object
resets the class variables so that a new file can be parsed is called by LearningDiary (through Paragraph) when preparing to parse a new txt file.
Instance Method Summary collapse
-
#process_times(new_times) ⇒ Object
Takes class start end times and dates as Time objects and amends the times, advancing the date if the start time has crossed midnight.
Class Attribute Details
.date ⇒ Object
Returns the value of attribute date.
15 16 17 |
# File 'lib/docfolio/paragraph_modules/times.rb', line 15 def date @date end |
.et ⇒ Object
Returns the value of attribute et.
15 16 17 |
# File 'lib/docfolio/paragraph_modules/times.rb', line 15 def et @et end |
.st ⇒ Object
Returns the value of attribute st.
15 16 17 |
# File 'lib/docfolio/paragraph_modules/times.rb', line 15 def st @st end |
Class Method Details
.reset ⇒ Object
resets the class variables so that a new file can be parsed is called by LearningDiary (through Paragraph) when preparing to parse a new txt file
21 22 23 |
# File 'lib/docfolio/paragraph_modules/times.rb', line 21 def self.reset TimeProcesser.date = TimeProcesser.st = TimeProcesser.et = nil end |
Instance Method Details
#process_times(new_times) ⇒ Object
Takes class start end times and dates as Time objects and amends the times, advancing the date if the start time has crossed midnight.
8 9 10 11 12 |
# File 'lib/docfolio/paragraph_modules/times.rb', line 8 def process_times(new_times) f_hour, f_min, t_hour, t_min = new_times to_start_time(f_hour, f_min) if has f_hour to_end_time(t_hour, t_min) if has t_hour end |