Module: Cucumber::Messages::Helpers::TimeConversion
- Defined in:
- lib/cucumber/messages/helpers/time_conversion.rb
Constant Summary collapse
- NANOSECONDS_PER_SECOND =
1_000_000_000
Instance Method Summary collapse
Instance Method Details
#time_to_timestamp(time) ⇒ Object
9 10 11 |
# File 'lib/cucumber/messages/helpers/time_conversion.rb', line 9 def (time) Cucumber::Messages::Timestamp.new(seconds: time.to_i, nanos: time.nsec) end |
#timestamp_to_time(timestamp) ⇒ Object
13 14 15 |
# File 'lib/cucumber/messages/helpers/time_conversion.rb', line 13 def () Time.at(.seconds, .nanos, :nanosecond) end |