Sha256: f3fe3fdbb13f1c7ddb2bd622b3e28ba3b512c73ad481c8532fd4378b268e3460

Contents?: true

Size: 582 Bytes

Versions: 1

Compression:

Stored size: 582 Bytes

Contents

module Trailblazer::V2_1
  class Operation
    class DeprecatedOptions < Option
      def self.call!(proc, direction, options, flow_options, *args)
        if proc.is_a?(Proc) && proc.arity == 1
          deprecate(proc)
          proc.(options)
        elsif proc.method(:call).arity == 1
          deprecate(proc)
          proc.(options)
        else
          super
        end
      end

      def self.deprecate(proc)
        warn "[Trailblazer::V2_1] Please use the step API `def my_step!(options, **)` for your step: #{proc}"
      end
    end # DeprecatedOptions
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trailblazer-future-2.1.0.rc1 lib/trailblazer/v2_1/operation/deprecations.rb