Sha256: 4047fbb720305788a3c4b33a3b56bbf83d9bd5a5edb5fd2ae3ea60041cb8997a

Contents?: true

Size: 533 Bytes

Versions: 6

Compression:

Stored size: 533 Bytes

Contents

module Tally
  module Calculators

    def calculators
      @calculators ||= []
    end

    def register_calculator(*class_name)
      @calculators ||= []

      class_name.each do |class_name|
        unless @calculators.include?(class_name.to_s)
          @calculators.push(class_name.to_s)
        end
      end

      nil
    end

    def unregister_calculator(*class_names)
      @calculators ||= []

      class_names = class_names.map(&:to_s)

      @calculators.delete_if { |n| class_names.include?(n) }
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tally-2.1.0 lib/tally/calculators.rb
tally-2.0.0 lib/tally/calculators.rb
tally-1.0.2 lib/tally/calculators.rb
tally-1.0.1 lib/tally/calculators.rb
tally-1.0.0 lib/tally/calculators.rb
tally-1.0.0.beta1 lib/tally/calculators.rb