Class: ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Commands::ExtractParams Private

Inherits:
ConvenientService::Support::Command show all
Defined in:
lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/extract_params.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ConvenientService::Support::Command

[], call

Constructor Details

#initialize(args:, kwargs:) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • args (Array<Object>)
  • kwargs (Hash{Symbol => Object})

Since:

  • 1.0.0



33
34
35
36
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/extract_params.rb', line 33

def initialize(args:, kwargs:)
  @args = args
  @kwargs = kwargs
end

Instance Attribute Details

#argsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



20
21
22
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/extract_params.rb', line 20

def args
  @args
end

#kwargsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



26
27
28
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/extract_params.rb', line 26

def kwargs
  @kwargs
end

Instance Method Details

#callConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Params

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Params)

Since:

  • 1.0.0



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/extract_params.rb', line 41

def call
  Structs::Params.new(
    action: args.first,
    inputs: Utils::Array.wrap(kwargs[:in]),
    outputs: Utils::Array.wrap(kwargs[:out]),
    strict: kwargs[:strict],
    index: kwargs[:index],
    container: kwargs[:container],
    organizer: kwargs[:organizer],
    extra_kwargs: Utils::Hash.except(kwargs, [:in, :out, :strict, :index, :container, :organizer])
  )
end