# require "eitil_integrate/application_exporter/auto_sum/format_data" module EitilIntegrate::RubyXL module AutoSum class << self def format_data format_time_strings format_ints_to_floats end def format_time_strings @hash.transform_values! { |array| array.map { |item| incomplete_time_string?(item) ? "#{item}:00" : item } } end def incomplete_time_string?(string) string.is_a?(String) && string.length == 5 && string.scan(/\d{2}:\d{2}/) end def format_ints_to_floats @hash.transform_values! { |array| array.map { |item| item.is_a?(Integer) ? item.to_f : item } } end end end end