Sha256: 9a8ff7b32c4aefbf56fe917decb60b2459c9b865a24e04bf48aa289d660d00cb

Contents?: true

Size: 366 Bytes

Versions: 1

Compression:

Stored size: 366 Bytes

Contents

# /lib/abrupt/transformation/client/visit.rb

def add_visit_duration
  leavetime = Abrupt.parse_time(@values[:leavetime])
  enterteime = Abrupt.parse_time(@values[:entertime])
  return unless leavetime || enterteime # maybe no recognized leavetime
  visit_duration = (leavetime - enterteime).to_f # in seconds
  add_data_property('visitDuration', visit_duration)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
abrupt-0.0.2 doc/paper/listings/add_visit_duration.rb