Module: TurbaChronos
- Defined in:
- lib/turba_chronos.rb,
lib/turba_chronos/day.rb,
lib/turba_chronos/rule.rb,
lib/turba_chronos/period.rb,
lib/turba_chronos/periods.rb,
lib/turba_chronos/version.rb,
lib/turba_chronos/timeline.rb,
lib/turba_chronos/stored_periods.rb,
lib/turba_chronos/period_converter.rb
Defined Under Namespace
Modules: StoredPeriods
Classes: Day, Period, PeriodConverter, Periods, Rule, Timeline
Constant Summary
collapse
- FULL_DAY_TIMERANGE =
['00:00', '23:59']
- VERSION =
"5.2.0"
Class Method Summary
collapse
Class Method Details
.current_numeric_time ⇒ Object
24
25
26
|
# File 'lib/turba_chronos.rb', line 24
def self.current_numeric_time
@current_numeric_time
end
|
.current_numeric_time=(current_numeric_time) ⇒ Object
28
29
30
|
# File 'lib/turba_chronos.rb', line 28
def self.current_numeric_time=(current_numeric_time)
@current_numeric_time = current_numeric_time
end
|
.load(periods, from, to, timezone = 'Europe/Paris') ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/turba_chronos.rb', line 16
def self.load(periods, from, to, timezone = 'Europe/Paris')
Time.zone = timezone
TurbaChronos.current_numeric_time = Time.zone.now.strftime("%k%M").to_i
periods = periods.map!(&:with_indifferent_access)
@timeline = Timeline.new(periods, Time.parse(from).utc, Time.parse(to).utc)
end
|