Sha256: d329f4ce5cf35249782080cd57d1360750e29e15efaff8f8148948933e5b234d

Contents?: true

Size: 1.34 KB

Versions: 5

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::HasResultSteps::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

5 entries across 5 versions & 1 rubygems

Version Path
convenient_service-0.10.1 lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb
convenient_service-0.10.0 lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb
convenient_service-0.9.0 lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb
convenient_service-0.8.0 lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb
convenient_service-0.7.0 lib/convenient_service/rspec/matchers/custom/results/base/commands/find_result_service_step.rb