Class: ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Commands::CastParams

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ConvenientService::Support::Command

[], call

Constructor Details

#initialize(original_params:) ⇒ void



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

def initialize(original_params:)
  @original_params = original_params
end

Instance Attribute Details

#original_paramsObject (readonly)

Returns the value of attribute original_params.



15
16
17
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb', line 15

def original_params
  @original_params
end

Instance Method Details

#actionObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



43
44
45
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb', line 43

def action
  @action ||= original_params.action
end

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



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb', line 28

def call
  Structs::Params.new(
    action: action,
    inputs: inputs,
    outputs: outputs,
    index: index,
    container: container,
    organizer: organizer,
    extra_kwargs: extra_kwargs
  )
end

#containerConvenientService::Service::Plugins::CanHaveSteps::Entities::Service



74
75
76
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb', line 74

def container
  @container ||= Entities::Service.cast!(original_params.container)
end

#extra_kwargsHash{Symbol => Object}

Returns:

  • (Hash{Symbol => Object})


88
89
90
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb', line 88

def extra_kwargs
  @extra_kwargs ||= original_params.extra_kwargs
end

#indexInteger

Returns:

  • (Integer)


67
68
69
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb', line 67

def index
  @index ||= original_params.index
end

#inputsArray<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method>



53
54
55
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb', line 53

def inputs
  @inputs ||= original_params.inputs.map { |input| Entities::Method.cast!(input, direction: :input) }
end

#organizerConvenientService::Service



81
82
83
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb', line 81

def organizer
  @organizer ||= original_params.organizer
end

#outputsArray<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method>



60
61
62
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/commands/cast_params.rb', line 60

def outputs
  @outputs ||= original_params.outputs.map { |output| Entities::Method.cast!(output, direction: :output) }
end