Method: Time#coerce
- Defined in:
- lib/openhab/core_ext/ruby/time.rb
#coerce(other) ⇒ Array?
Converts to a ZonedDateTime if other is also convertible to a ZonedDateTime.
115 116 117 118 119 120 121 |
# File 'lib/openhab/core_ext/ruby/time.rb', line 115 def coerce(other) logger.trace { "Coercing #{self} as a request from #{other.class}" } return unless other.respond_to?(:to_zoned_date_time) zdt = to_zoned_date_time [other.to_zoned_date_time(zdt), zdt] end |