Class: Cucumber::Messages::Duration
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb
Overview
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.
Instance Attribute Summary collapse
-
#nanos ⇒ Object
readonly
Non-negative fractions of a second at nanosecond resolution.
-
#seconds ⇒ Object
readonly
Returns the value of attribute seconds.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new Duration from the given hash.
Instance Method Summary collapse
-
#initialize(seconds: 0, nanos: 0) ⇒ Duration
constructor
A new instance of Duration.
Methods included from Message::Utils
Methods included from Message::Serialization
Methods included from Message::Deserialization
Constructor Details
#initialize(seconds: 0, nanos: 0) ⇒ Duration
Returns a new instance of Duration.
128 129 130 131 132 133 134 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 128 def initialize( seconds: 0, nanos: 0 ) @seconds = seconds @nanos = nanos end |
Instance Attribute Details
#nanos ⇒ Object (readonly)
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.
126 127 128 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 126 def nanos @nanos end |
#seconds ⇒ Object (readonly)
Returns the value of attribute seconds.
118 119 120 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 118 def seconds @seconds end |
Class Method Details
.from_h(hash) ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/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 |