Sha256: ff3aa61d2f6c565d6c299bfa59ba187fdea292aa268e37819b6a1158deb6261c

Contents?: true

Size: 639 Bytes

Versions: 7

Compression:

Stored size: 639 Bytes

Contents

# frozen_string_literal: true

#
# Copyright (c) 2018-present, Blue Marble Payroll, LLC
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#

module Differential
  module Calculator
    # There are multiple classes that all need calculation support (The Total class.)
    # Instead of using inheritance, those classes can use this mix-in for composition.
    module HasTotals
      extend Forwardable

      def_delegators :totals, :a_sigma, :b_sigma, :delta

      def totals
        @totals ||= ::Differential::Calculator::Totals.new
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
differential-1.1.0 lib/differential/calculator/has_totals.rb
differential-1.0.6 lib/differential/calculator/has_totals.rb
differential-1.0.5 lib/differential/calculator/has_totals.rb
differential-1.0.4 lib/differential/calculator/has_totals.rb
differential-1.0.3 lib/differential/calculator/has_totals.rb
differential-1.0.2 lib/differential/calculator/has_totals.rb
differential-1.0.1 lib/differential/calculator/has_totals.rb