class Runreg::Event
Public Class Methods
convert_datetime(string)
click to toggle source
Date/times come in format /Date(1592625600000-0400)/
# File lib/runreg/event.rb, line 16 def self.convert_datetime string DateTime.strptime(string, '/Date(%Q%z)/').to_s end
new(hash)
click to toggle source
Calls superclass method
# File lib/runreg/event.rb, line 5 def initialize hash hash.keys.each do |key| if key.match?(/Date/) && hash[key] hash[key] = Runreg::Event.convert_datetime(hash[key]) end end super hash end