Sha256: 8b3c4625aaf109534f664666f0cfba7c4648c5ca69e9aa05fd6908c80f64c264

Contents?: true

Size: 609 Bytes

Versions: 5

Compression:

Stored size: 609 Bytes

Contents

module Indexed
  module Wrappers

    module Bundle

      # A calculation rewrites the symbol into a float.
      #
      # TODO I really need to allow integers as keys. The code below is just not up to the needed quality.
      #
      class Calculation < Wrapper

        #
        #
        def recalculate float
          float
        end

        #
        #
        def ids sym
          @bundle.ids recalculate(sym.to_s.to_f).to_s.to_sym
        end

        #
        #
        def weight sym
          @bundle.weight recalculate(sym.to_s.to_f).to_s.to_sym
        end

      end

    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
picky-2.7.0 lib/picky/indexed/wrappers/bundle/calculation.rb
picky-2.6.0 lib/picky/indexed/wrappers/bundle/calculation.rb
picky-2.1.2 lib/picky/internals/indexed/wrappers/bundle/calculation.rb
picky-2.1.1 lib/picky/internals/indexed/wrappers/bundle/calculation.rb
picky-2.1.0 lib/picky/internals/indexed/wrappers/bundle/calculation.rb