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
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#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, id: nil) ⇒ TestRunStarted
constructor
A new instance of TestRunStarted.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(timestamp: Timestamp.new, id: nil) ⇒ TestRunStarted
Returns a new instance of TestRunStarted.
15 16 17 18 19 20 21 22 |
# File 'lib/cucumber/messages/test_run_started.rb', line 15 def initialize( timestamp: Timestamp.new, id: nil ) @timestamp = @id = id super() end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
13 14 15 |
# File 'lib/cucumber/messages/test_run_started.rb', line 13 def id @id end |
#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... ...>
31 32 33 34 35 36 37 38 |
# File 'lib/cucumber/messages/test_run_started.rb', line 31 def self.from_h(hash) return nil if hash.nil? new( timestamp: Timestamp.from_h(hash[:timestamp]), id: hash[:id] ) end |