Sha256: eda75fa25da1d5b96fda5b4a518ea1a0fc9ce38cd28b9648bcf6b9e6b03c33bd

Contents?: true

Size: 840 Bytes

Versions: 39

Compression:

Stored size: 840 Bytes

Contents

module Picky

  module Wrappers

    module Bundle

      # A calculation rewrites the symbol into a float.
      #
      # Note: A calculation will try to find a float in the index,
      #       not a sym.
      #
      class Calculation < Wrapper

        # API.
        #
        # By default, a calculation does not
        # calculate anything.
        #
        def calculate float
          float
        end

        # TODO Symbols. Use a block here?
        #
        # THINK Move the calculation elsewhere?
        #
        def ids float_str
          @bundle.ids calculate(float_str.to_f).to_s
        end

        # TODO Symbols.
        #
        # THINK Move the calculation elsewhere?
        #
        def weight float_str
          @bundle.weight calculate(float_str.to_f).to_s
        end

      end

    end

  end

end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
picky-4.6.0 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.12 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.11 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.10 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.9 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.8 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.7 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.6 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.5 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.4 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.3 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.2 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.1 lib/picky/wrappers/bundle/calculation.rb
picky-4.5.0 lib/picky/wrappers/bundle/calculation.rb
picky-4.4.2 lib/picky/wrappers/bundle/calculation.rb
picky-4.4.1 lib/picky/wrappers/bundle/calculation.rb
picky-4.4.0 lib/picky/wrappers/bundle/calculation.rb
picky-4.3.2 lib/picky/wrappers/bundle/calculation.rb
picky-4.3.1 lib/picky/wrappers/bundle/calculation.rb
picky-4.3.0 lib/picky/wrappers/bundle/calculation.rb