Sha256: 89f38b1598d01742ad03274e8274ec5ef74a33b8e308b49fd401bce52e90e059

Contents?: true

Size: 807 Bytes

Versions: 4

Compression:

Stored size: 807 Bytes

Contents

# frozen_string_literal: true

module Trailblazer
  class Finder
    module Activity
      module Process
        # Process Predicates Activity
        module Predicates
          extend Trailblazer::Activity::Railway()

          module_function

          def set_properties_handler(ctx, **)
            return true if ctx[:process].nil?

            ctx[:process].each do |key, _value|
              next if ctx[:process][key][:predicate].nil?

              ctx[:process][key][:handler] = Utils::Extra.apply_handler(
                (Object.const_get(ctx[:orm][:predicates]).__send__ "set_#{ctx[:process][key][:predicate]}_handler".to_sym)
              )
            end
          end

          step method(:set_properties_handler), id: :set_properties_handler
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trailblazer-finder-0.3.0 lib/trailblazer/finder/activity/process/predicates.rb
trailblazer-finder-0.2.7 lib/trailblazer/finder/activity/process/predicates.rb
trailblazer-finder-0.2.6 lib/trailblazer/finder/activity/process/predicates.rb
trailblazer-finder-0.2.5 lib/trailblazer/finder/activity/process/predicates.rb