Class: Formidable::Timer

Inherits:
Object
  • Object
show all
Defined in:
lib/formidable/timer.rb

Class Method Summary collapse

Class Method Details

.parse(timing_data) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/formidable/timer.rb', line 8

def parse(timing_data)
  js_data = JSON.parse(Base64.decode64(timing_data)) rescue nil
  if js_data
    return js_data["total_time"], js_data["times"]
  end
  return nil, {}
end