Sha256: c75aea2c74d727d13bf2805b85b64ccbfeacdefb9a18a1faae9c4bc41389b67c

Contents?: true

Size: 282 Bytes

Versions: 13

Compression:

Stored size: 282 Bytes

Contents

module ActiveReporter
  module Calculator
    class Ratio < ActiveReporter::Calculator::Base
      def calculate(row, parent_row)
        ((row[aggregator].to_f / parent_row[parent_aggregator].to_f) * 100) unless parent_row[parent_aggregator].to_f.zero?
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
active_reporter-0.7.1 lib/active_reporter/calculator/ratio.rb
active_reporter-0.6.5 lib/active_reporter/calculator/ratio.rb
active_reporter-0.6.4 lib/active_reporter/calculator/ratio.rb
active_reporter-0.6.3 lib/active_reporter/calculator/ratio.rb
active_reporter-0.6.2 lib/active_reporter/calculator/ratio.rb
active_reporter-0.6.1 lib/active_reporter/calculator/ratio.rb
active_reporter-0.6.0 lib/active_reporter/calculator/ratio.rb
active_reporter-0.5.13 lib/active_reporter/calculator/ratio.rb
active_reporter-0.5.12 lib/active_reporter/calculator/ratio.rb
active_reporter-0.5.11 lib/active_reporter/calculator/ratio.rb
active_reporter-0.5.10 lib/active_reporter/calculator/ratio.rb
active_reporter-0.5.9 lib/active_reporter/calculator/ratio.rb
active_reporter-0.5.8 lib/active_reporter/calculator/ratio.rb