Sha256: fe7cad35f0e2974ef0d0a06859ede0f4e825be8bc3798db8a60306e3a5ffe054

Contents?: true

Size: 393 Bytes

Versions: 8

Compression:

Stored size: 393 Bytes

Contents

module JunoReport
	module Pdf
		module Behaviors
			def self.sum old_value, new_value
				value = (old_value.to_f + new_value.to_f).to_s
				(/^[0-9]+(?=\.)/.match value).nil? ? value : value[/^[0-9]+(?=\.)/]
			end

			def self.substract old_value, new_value
				old_value.to_f - new_value.to_f
			end

			def self.count old_value, new_value = nil
				old_value.to_i + 1
			end
		end
	end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
juno-report-0.1.6 lib/juno-report/pdf/behaviors.rb
juno-report-0.1.2 lib/juno-report/pdf/behaviors.rb
juno-report-0.1.1 lib/juno-report/pdf/behaviors.rb
juno-report-0.0.9 lib/juno-report/pdf/behaviors.rb
juno-report-0.0.8 lib/juno-report/pdf/behaviors.rb
juno-report-0.0.7 lib/juno-report/pdf/behaviors.rb
juno-report-0.0.6 lib/juno-report/pdf/behaviors.rb
juno-report-0.0.5 lib/juno-report/pdf/behaviors.rb