Sha256: 8656ebce9a68c84a093dab0352f16ea763e6e25ba71741962ff5fd3e18b1129b

Contents?: true

Size: 797 Bytes

Versions: 8

Compression:

Stored size: 797 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module HasJSendResultShortSyntax
        module Concern
          include Support::Concern

          class_methods do
            ##
            # @internal
            #   NOTE: Delegates to `result` instead of aliasing in order to have an ability
            #   to use the same RSpec stubs for short and usual syntax.
            #
            #   For example:
            #
            #     allow(Service).to receive(:result).with(foo: :bar).and_call_original
            #
            #   works for both `Service.result(foo: :bar)` and `Service[foo: :bar]`.
            #
            def [](...)
              result(...)
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/service/plugins/has_j_send_result_short_syntax/concern.rb
convenient_service-0.19.0 lib/convenient_service/service/plugins/has_j_send_result_short_syntax/concern.rb
convenient_service-0.18.0 lib/convenient_service/service/plugins/has_j_send_result_short_syntax/concern.rb
convenient_service-0.17.0 lib/convenient_service/service/plugins/has_j_send_result_short_syntax/concern.rb
convenient_service-0.16.0 lib/convenient_service/service/plugins/has_j_send_result_short_syntax/concern.rb
convenient_service-0.15.0 lib/convenient_service/service/plugins/has_j_send_result_short_syntax/concern.rb
convenient_service-0.14.0 lib/convenient_service/service/plugins/has_j_send_result_short_syntax/concern.rb
convenient_service-0.13.0 lib/convenient_service/service/plugins/has_j_send_result_short_syntax/concern.rb