Sha256: 28d6484024285a67fd086a3586e16aca07ac95be2e2eeb9d779b3d3e74ccd579

Contents?: true

Size: 859 Bytes

Versions: 111

Compression:

Stored size: 859 Bytes

Contents

module Picky

  module Generators
    module Weights

      # Is used for runtime-only strategies.
      #
      # Note: Pretends to be a backend but
      #       does nothing at all.
      #
      # To override, implement:
      #   * [symbol_or_string] # During runtime.
      #   * weight_for(size)   # During indextime. # Probably never used.
      #
      class Stub < Strategy

        # It is not saved, by default.
        #
        def saved?
          false
        end

        # Nothing needs to be deleted from it.
        #
        def delete _

        end

        # It does not need to be cleared.
        #
        def clear

        end

        # Returns nil.
        #
        def weight_for _
          # Nothing.
        end

        # Saves nothing by default.
        #
        def []= _, _

        end

      end
    end
  end

end

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
picky-4.31.3 lib/picky/generators/weights/stub.rb
picky-4.31.2 lib/picky/generators/weights/stub.rb
picky-4.31.1 lib/picky/generators/weights/stub.rb
picky-4.31.0 lib/picky/generators/weights/stub.rb
picky-4.30.0 lib/picky/generators/weights/stub.rb
picky-4.29.0 lib/picky/generators/weights/stub.rb
picky-4.28.1 lib/picky/generators/weights/stub.rb
picky-4.27.1 lib/picky/generators/weights/stub.rb
picky-4.27.0 lib/picky/generators/weights/stub.rb
picky-4.26.2 lib/picky/generators/weights/stub.rb
picky-4.26.1 lib/picky/generators/weights/stub.rb
picky-4.26.0 lib/picky/generators/weights/stub.rb
picky-4.25.3 lib/picky/generators/weights/stub.rb
picky-4.25.2 lib/picky/generators/weights/stub.rb
picky-4.25.1 lib/picky/generators/weights/stub.rb
picky-4.25.0 lib/picky/generators/weights/stub.rb
picky-4.24.0 lib/picky/generators/weights/stub.rb
picky-4.23.2 lib/picky/generators/weights/stub.rb
picky-4.23.1 lib/picky/generators/weights/stub.rb
picky-4.23.0 lib/picky/generators/weights/stub.rb