Sha256: 8c0ba20419a7f04c6167d1407cd7551df7b15750ba23c066c6b15f4637ee74df

Contents?: true

Size: 1.34 KB

Versions: 2

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module RSpec
    module Matchers
      module Custom
        module Results
          class Base
            module Commands
              class FindResultServiceStep < Support::Command
                ##
                # @!attribute result [r]
                #   @return [ConvenientService::Service::Plugins::HasResult::Entities::Result]
                #
                attr_reader :result

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

                ##
                # @param result [ConvenientService::Service::Plugins::HasResult::Entities::Result]
                # @param service_class [Class]
                # @return [void]
                #
                def initialize(result:, service_class:)
                  @result = result
                  @service_class = service_class
                end

                ##
                # @return [ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method]
                #
                def call
                  return nil unless result.step

                  result.step.service_class == service_class
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
convenient_service-0.12.0 lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb
convenient_service-0.11.0 lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb