Module: OpenHAB::DSL::Timer::TimeCopStackItem

Defined in:
lib/rspec/openhab/dsl/timers/timer.rb

Overview

extend Timecop to support java time classes

Instance Method Summary collapse

Instance Method Details

#parse_time(*args) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/rspec/openhab/dsl/timers/timer.rb', line 21

def parse_time(*args)
  if args.length == 1 && args.first.is_a?(Duration)
    return time_klass.at(ZonedDateTime.now.plus(args.first).to_instant.to_epoch_milli / 1000.0)
  end

  super
end