Sha256: de62ea475ce1c4dccf601042510eaf1f04b9263abbb389fc9d7719d9bb1ad0dd

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

require_relative "wrap_method/entities"
require_relative "wrap_method/exceptions"

module ConvenientService
  module RSpec
    module Helpers
      module Custom
        class WrapMethod < Support::Command
          ##
          # @!attribute [r] entity
          #   @return [Object] Can be any type.
          #
          attr_reader :entity

          ##
          # @!attribute [r] method
          #   @return [Symbol, String]
          #
          attr_reader :method

          ##
          # @!attribute [r] observe_middleware
          #   @return [Class]
          #
          attr_reader :observe_middleware

          ##
          # @param entity [Object] Can be any type.
          # @param method [Symbol, String]
          # @param observe_middleware [Class]
          # @return [void]
          #
          def initialize(entity, method, observe_middleware:)
            @entity = entity
            @method = method
            @observe_middleware = observe_middleware
          end

          ##
          # @return [ConvenientService::RSpec::Helpers::Custom::Entities::WrappedMethod]
          #
          def call
            Entities::WrappedMethod.new(entity: entity, method: method, observe_middleware: observe_middleware)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
convenient_service-0.14.0 lib/convenient_service/rspec/helpers/custom/wrap_method.rb
convenient_service-0.13.0 lib/convenient_service/rspec/helpers/custom/wrap_method.rb