Sha256: 8e8c0f6a87dc9751d9d19fc0163ffa9b6da6c01b5168ac72b5b77c1e6cc08175

Contents?: true

Size: 620 Bytes

Versions: 8

Compression:

Stored size: 620 Bytes

Contents

# frozen_string_literal: true

module Invoca
  module Utils
    class MultiSender
      undef_method(*(instance_methods - [:__id__, :__send__, :object_id]))

      def initialize(enumerable, method)
        @enumerable = enumerable
        @method     = method
      end

      # rubocop:disable Style/MethodMissingSuper
      # rubocop:disable Style/MissingRespondToMissing
      def method_missing(name, *args, &block)
        @enumerable.send(@method) { |x| x.send(name, *args, &block) }
      end
      # rubocop:enable Style/MethodMissingSuper
      # rubocop:enable Style/MissingRespondToMissing
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
invoca-utils-0.6.0 lib/invoca/utils/multi_sender.rb
invoca-utils-0.5.1 lib/invoca/utils/multi_sender.rb
invoca-utils-0.5.0 lib/invoca/utils/multi_sender.rb
invoca-utils-0.4.1 lib/invoca/utils/multi_sender.rb
invoca-utils-0.4.0 lib/invoca/utils/multi_sender.rb
invoca-utils-0.3.0 lib/invoca/utils/multi_sender.rb
invoca-utils-0.2.0 lib/invoca/utils/multi_sender.rb
invoca-utils-0.2.0.pre.1 lib/invoca/utils/multi_sender.rb