Class: MetOnTheMiddle::Readers::TotalTime

Inherits:
Base
  • Object
show all
Defined in:
lib/met_on_the_middle/readers/total_time.rb

Instance Attribute Summary

Attributes inherited from Base

#key

Instance Method Summary collapse

Methods inherited from Base

#register_subscription, #to_key_value

Constructor Details

#initializeTotalTime

Returns a new instance of TotalTime.



4
5
6
# File 'lib/met_on_the_middle/readers/total_time.rb', line 4

def initialize
  super(:total_time)
end

Instance Method Details

#match_subscriptionObject



8
9
10
# File 'lib/met_on_the_middle/readers/total_time.rb', line 8

def match_subscription
  'met_on_the_middle.total_time'
end

#parse(event, request: nil) ⇒ Object



12
13
14
# File 'lib/met_on_the_middle/readers/total_time.rb', line 12

def parse(event,request:nil)
  event.duration.round(2)
end