Method: DateTime#plus_with_temporal

Defined in:
lib/openhab/core_ext/ruby/date_time.rb

#plus_with_temporal(other) ⇒ ZonedDateTime, Time Also known as: +

Extends #+ to allow adding a TemporalAmount

Parameters:

  • other (java.time.temporal.TemporalAmount)

Returns:



17
18
19
20
21
# File 'lib/openhab/core_ext/ruby/date_time.rb', line 17

def plus_with_temporal(other)
  return to_zoned_date_time + other.to_temporal_amount if other.respond_to?(:to_temporal_amount)

  plus_without_temporal(other)
end