class Cucumber::Messages::Duration
Represents the Duration
message in Cucumber’s message protocol.
The structure is pretty close of the Timestamp
one. For clarity, a second type
of message is used.
Attributes
Non-negative fractions of a second at nanosecond resolution. Negative
second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive.
Public Class Methods
Source
# File lib/cucumber/messages.deserializers.rb, line 46 def self.from_h(hash) return nil if hash.nil? self.new( seconds: hash[:seconds], nanos: hash[:nanos], ) end
Returns a new Duration
from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.
Cucumber::Messages::Duration.from_h(some_hash) # => #<Cucumber::Messages::Duration:0x... ...>
Source
# File lib/cucumber/messages.dtos.rb, line 128 def initialize( seconds: 0, nanos: 0 ) @seconds = seconds @nanos = nanos end