Sha256: 847837c157651ecf286a20c3f295a4470b361beac55f6e9ebfc9dc7c3f35ac0f

Contents?: true

Size: 739 Bytes

Versions: 70

Compression:

Stored size: 739 Bytes

Contents

# require "eitil_integrate/application_exporter/auto_sum/present_data"

module EitilIntegrate::RubyXL
  module AutoSum
    class << self

      # As final step, prepare the data for the excel file, according to formatting requirements.

      def present_data
        transform_floats_to_integers
        transform_values_to_strings
        set_title
      end

      def transform_floats_to_integers
        @hash.transform_values! { |value| value.is_a?(Float) ? value.safe_to_i.round(3) : value }
      end

      def transform_values_to_strings
        @hash.transform_values! { |value| value&.to_s }
      end

      def set_title
        # @hash[0] = 'Totaal' unless @hash[0]
        @hash[0] = 'Totaal'
      end

    end
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
eitil-1.3.1 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.0 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.2.4 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.2.3 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.2.2 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.2.1 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.2.0 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.39 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.38 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.37 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.36 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.35 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.34 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.33 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.32 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.31 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.30 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.29 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.28 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.1.27 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb