Sha256: 66a60a0b03a192319b66209b0e58dc6ed81f04ffdf3d28540019d9af1404937b

Contents?: true

Size: 680 Bytes

Versions: 7

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Services
    class RunMethodInOrganizer
      ##
      # @internal
      #   TODO: Reuse parent config?
      #
      include Configs::Standard

      attr_reader :method_name, :organizer, :kwargs

      def initialize(method_name:, organizer:, **kwargs)
        @method_name = method_name
        @organizer = organizer
        @kwargs = kwargs
      end

      def result
        ##
        # NOTE: `kwargs` are intentionally NOT passed, since all the corresponding methods are available inside `organizer.__send__(method_name)` body.
        #
        organizer.__send__(method_name)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
convenient_service-0.12.0 lib/convenient_service/services/run_method_in_organizer.rb
convenient_service-0.11.0 lib/convenient_service/services/run_method_in_organizer.rb
convenient_service-0.10.1 lib/convenient_service/services/run_method_in_organizer.rb
convenient_service-0.10.0 lib/convenient_service/services/run_method_in_organizer.rb
convenient_service-0.9.0 lib/convenient_service/services/run_method_in_organizer.rb
convenient_service-0.8.0 lib/convenient_service/services/run_method_in_organizer.rb
convenient_service-0.7.0 lib/convenient_service/services/run_method_in_organizer.rb