Class: Kaal::SchedulerTimeZoneResolver
- Inherits:
-
Object
- Object
- Kaal::SchedulerTimeZoneResolver
- Defined in:
- lib/kaal/config/scheduler_time_zone_resolver.rb
Overview
Resolves the configured scheduler time zone, preferring explicit config.
Constant Summary collapse
- DEFAULT_TIME_ZONE =
'UTC'
Instance Method Summary collapse
-
#initialize(configuration:) ⇒ SchedulerTimeZoneResolver
constructor
A new instance of SchedulerTimeZoneResolver.
- #time_zone_identifier ⇒ Object
Constructor Details
#initialize(configuration:) ⇒ SchedulerTimeZoneResolver
Returns a new instance of SchedulerTimeZoneResolver.
14 15 16 |
# File 'lib/kaal/config/scheduler_time_zone_resolver.rb', line 14 def initialize(configuration:) @configuration = configuration end |
Instance Method Details
#time_zone_identifier ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/kaal/config/scheduler_time_zone_resolver.rb', line 18 def time_zone_identifier zone = begin Time.zone rescue NoMethodError nil end configured_time_zone || zone&.tzinfo&.identifier || DEFAULT_TIME_ZONE end |