Sha256: bfb407b06303c8687c8a7709cd613b67bda1db2ad2afff10c166eaf3786adfd5

Contents?: true

Size: 1.37 KB

Versions: 3

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module CanHaveSteps
        module Entities
          class Step
            module Plugins
              module CanHaveFallbacks
                module Concern
                  include Support::Concern

                  instance_methods do
                    ##
                    # @return [Bool]
                    #
                    def fallback_true_step?
                      params.extra_kwargs[:fallback] == true
                    end

                    ##
                    # @return [Bool]
                    #
                    def fallback_failure_step?
                      Utils::Array.wrap(params.extra_kwargs[:fallback]).include?(:failure)
                    end

                    ##
                    # @return [Bool]
                    #
                    def fallback_error_step?
                      Utils::Array.wrap(params.extra_kwargs[:fallback]).include?(:error)
                    end

                    ##
                    # @return [Bool]
                    #
                    def fallback_step?
                      fallback_true_step? || fallback_failure_step? || fallback_error_step?
                    end
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/concern.rb
convenient_service-0.19.0 lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/concern.rb
convenient_service-0.18.0 lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/concern.rb