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-2.0.6 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-2.0.5 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-2.0.4 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-2.0.3 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-2.0.2 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-2.0.1 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-2.0.0 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.4.1 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.4.0 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.12 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.11 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.10 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.9 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.8 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.7 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.6 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.5 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.4 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.3 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb
eitil-1.3.2 eitil_integrate/lib/eitil_integrate/application_exporter/auto_sum/present_data.rb