Class: Cucumber::Messages::TestRunStarted
- Defined in:
- lib/cucumber/messages/test_run_started.rb
Overview
Represents the TestRunStarted message in Cucumber’s message protocol.
Instance Attribute Summary collapse
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new TestRunStarted from the given hash.
Instance Method Summary collapse
-
#initialize(timestamp: Timestamp.new) ⇒ TestRunStarted
constructor
A new instance of TestRunStarted.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(timestamp: Timestamp.new) ⇒ TestRunStarted
Returns a new instance of TestRunStarted.
13 14 15 16 17 18 |
# File 'lib/cucumber/messages/test_run_started.rb', line 13 def initialize( timestamp: Timestamp.new ) @timestamp = super() end |
Instance Attribute Details
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
11 12 13 |
# File 'lib/cucumber/messages/test_run_started.rb', line 11 def @timestamp end |
Class Method Details
.from_h(hash) ⇒ Object
Returns a new TestRunStarted from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.
Cucumber::Messages::TestRunStarted.from_h(some_hash) # => #<Cucumber::Messages::TestRunStarted:0x... ...>
27 28 29 30 31 32 33 |
# File 'lib/cucumber/messages/test_run_started.rb', line 27 def self.from_h(hash) return nil if hash.nil? new( timestamp: Timestamp.from_h(hash[:timestamp]) ) end |