Class: RSpec::Notifications::Subscriber::Event

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec/notifications/subscriber.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#finishedObject

Returns the value of attribute finished

Returns:

  • (Object)

    the current value of finished



9
10
11
# File 'lib/rspec/notifications/subscriber.rb', line 9

def finished
  @finished
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



9
10
11
# File 'lib/rspec/notifications/subscriber.rb', line 9

def name
  @name
end

#payloadObject

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



9
10
11
# File 'lib/rspec/notifications/subscriber.rb', line 9

def payload
  @payload
end

#startedObject

Returns the value of attribute started

Returns:

  • (Object)

    the current value of started



9
10
11
# File 'lib/rspec/notifications/subscriber.rb', line 9

def started
  @started
end

#transaction_idObject

Returns the value of attribute transaction_id

Returns:

  • (Object)

    the current value of transaction_id



9
10
11
# File 'lib/rspec/notifications/subscriber.rb', line 9

def transaction_id
  @transaction_id
end

Instance Method Details

#durationObject

Duration in milliseconds, when both timestamps are available.



18
19
20
21
22
# File 'lib/rspec/notifications/subscriber.rb', line 18

def duration
  return unless started && finished

  (finished - started) * 1_000.0
end