Sha256: d4361eabf740783e4a1c1caa25ca58144212ca5f9dbbfbf5f356aa8cb5cb9b34

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module CanHaveSteps
        module Entities
          class Method
            module Entities
              module Callers
                class Usual < Callers::Base
                  def calculate_value(method)
                    method.organizer.__send__(method.name.to_s)
                  end

                  def validate_as_input_for_container!(container, method:)
                    return true if container.has_defined_method?(method)

                    raise Errors::InputMethodIsNotDefinedInContainer.new(method: method, container: container)
                  end

                  def validate_as_output_for_container!(container, method:)
                    return true unless container.has_defined_method?(method)

                    raise Errors::OutputMethodIsDefinedInContainer.new(method: method, container: container)
                  end

                  def define_output_in_container!(container, index:, method:)
                    Commands::DefineMethodInContainer.call(method: method, container: container, index: index)
                  end
                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/service/plugins/can_have_steps/entities/method/entities/callers/usual.rb
convenient_service-0.11.0 lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/usual.rb