Sha256: 89df750e81c7e194af15607f2a90c9ccdc17c83837c0aaab0f9b083e4a299092

Contents?: true

Size: 808 Bytes

Versions: 3

Compression:

Stored size: 808 Bytes

Contents

# frozen_string_literal: true

module Rack
  module Reducer
    module Warnings
      MESSAGES = {
        new: [
          'Rack::Reducer.new will become an alias of ::create in v2.',
          'To mount middleware that will still work in 2.0, write',
          '"use Rack::Reducer::Middleware" instead of "use Rack::Reducer"',
        ],
        reduces: [
          'Rack::Reducer’s mixin-style is deprecated and may be removed in v2.',
          'To keep using Rack::Reducer in your models, use a Reducer constant.',
          'class MyModel',
          '  MyReducer = Rack::Reducer.create(dataset, *filter_functions)',
          'end',
          'MyModel::MyReducer.call(params)',
        ]
      }.freeze

      def self.[](key)
        MESSAGES.fetch(key, []).join("\n")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-reducer-1.1.2 lib/rack/reducer/warnings.rb
rack-reducer-1.1.1 lib/rack/reducer/warnings.rb
rack-reducer-1.1.0 lib/rack/reducer/warnings.rb