Sha256: 3a43f5c7dfaa35c6a919dfd0ca46864d38c063fabd93e4bc94ee28fe346f1447
Contents?: true
Size: 847 Bytes
Versions: 62
Compression:
Stored size: 847 Bytes
Contents
# 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 # outcommented method in favour of AutoSum#chronic_sum_array: no longer accept days, since the method excepts # either hh:mm or hh:mm:ss # 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
Version data entries
62 entries across 62 versions & 1 rubygems