Sha256: be033c23889a74c1e0ea7a9e384bbe4075527eb6a19f4a9e7246a340d91f526c

Contents?: true

Size: 1.48 KB

Versions: 7

Compression:

Stored size: 1.48 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module HasResultSteps
        module Entities
          class Method
            module Commands
              class CastMethod < Support::Command
                attr_reader :other, :options

                def initialize(other:, options:)
                  @other = other
                  @options = options
                end

                def call
                  return unless key
                  return unless name
                  return unless caller
                  return unless direction

                  ##
                  # https://en.wikipedia.org/wiki/Composition_over_inheritance
                  #
                  Method.new(key: key, name: name, caller: caller, direction: direction)
                end

                private

                def key
                  @key ||= Commands::CastMethodKey.call(other: other, options: options)
                end

                def name
                  @name ||= Commands::CastMethodName.call(other: other, options: options)
                end

                def caller
                  @caller ||= Commands::CastMethodCaller.call(other: other, options: options)
                end

                def direction
                  @direction ||= Commands::CastMethodDirection.call(other: other, options: options)
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
convenient_service-0.5.0 lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method.rb
convenient_service-0.4.0 lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method.rb
convenient_service-0.3.1 lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method.rb
convenient_service-0.3.0 lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method.rb
convenient_service-0.2.1 lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method.rb
convenient_service-0.2.0 lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method.rb
convenient_service-0.1.0 lib/convenient_service/service/plugins/has_result_steps/entities/method/commands/cast_method.rb