class ActionCounter::Audit
Public Class Methods
new(action_name:, list:)
click to toggle source
# File lib/action_counter.rb, line 78 def initialize(action_name:, list:) @action_name = action_name @list = list end
Public Instance Methods
start()
click to toggle source
# File lib/action_counter.rb, line 83 def start @start_time = Time.now self end
stop()
click to toggle source
# File lib/action_counter.rb, line 88 def stop @end_time = Time.now time_sec = @end_time - @start_time h = { action_name: @action_name, time_sec: time_sec } @list << h.to_json h end