Module: ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Concern::InstanceMethods

Includes:
ConvenientService::Support::Copyable, ConvenientService::Support::Delegate
Defined in:
lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ConvenientService::Support::Delegate::ClassMethodsForForwardable

#delegate

Methods included from ConvenientService::Support::Copyable

#copy

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



27
28
29
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 27

def args
  @args
end

#kwargsObject (readonly)

Returns the value of attribute kwargs.



33
34
35
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 33

def kwargs
  @kwargs
end

Instance Method Details

#==(other) ⇒ Boolean?

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:

  • other (Object)

    Can be any type.

Returns:

  • (Boolean, nil)


275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 275

def ==(other)
  return unless other.instance_of?(self.class)

  return false if action != other.action
  return false if inputs != other.inputs
  return false if outputs != other.outputs
  return false if index != other.index
  return false if container != other.container
  return false if organizer(raise_when_missing: false) != other.organizer(raise_when_missing: false)
  return false if extra_kwargs != other.extra_kwargs

  true
end

#actionConvenientService::Service::Plugins::CanHaveSteps::Entities::Service



73
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 73

delegate :action, to: :params

#codeConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Code



53
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 53

delegate :code, to: :result

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



97
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 97

delegate :container, to: :params

#dataConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Data



43
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 43

delegate :data, to: :result

#define!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.

This method returns an undefined value.



263
264
265
266
267
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 263

def define!
  outputs.each { |output| output.define_output_in_container!(container, index: index) }

  true
end

#error?Boolean

Returns:

  • (Boolean)


117
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 117

delegate :error?, to: :result

#extra_kwargsHash{Symbol => Object}

Returns:

  • (Hash{Symbol => Object})


102
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 102

delegate :extra_kwargs, to: :params

#failure?Boolean

Returns:

  • (Boolean)


112
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 112

delegate :failure?, to: :result

#has_organizer?Boolean

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:

  • (Boolean)


220
221
222
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 220

def has_organizer?
  Utils.to_bool(organizer(raise_when_missing: false))
end

#indexInteger

Returns:

  • (Integer)


92
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 92

delegate :index, to: :params

#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})


141
142
143
144
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 141

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

#input_valuesHash{Symbol => Object}



183
184
185
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 183

def input_values
  @input_values ||= calculate_input_values
end

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



80
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 80

delegate :inputs, to: :params

#messageConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Message



48
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 48

delegate :message, to: :result

#not_error?Boolean

Returns:

  • (Boolean)


132
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 132

delegate :not_error?, to: :result

#not_failure?Boolean

Returns:

  • (Boolean)


127
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 127

delegate :not_failure?, to: :result

#not_success?Boolean

Returns:

  • (Boolean)


122
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 122

delegate :not_success?, to: :result

#organizer(raise_when_missing: true) ⇒ ConvenientService::Service

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.



169
170
171
172
173
174
175
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 169

def organizer(raise_when_missing: true)
  @organizer ||= params.organizer

  ::ConvenientService.raise Exceptions::StepHasNoOrganizer.new(step: self) if @organizer.nil? && raise_when_missing

  @organizer
end

#output_valuesHash{Symbol => Object}

Returns:

  • (Hash{Symbol => Object})

Raises:



193
194
195
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 193

def output_values
  @output_values ||= calculate_output_values
end

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



87
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 87

delegate :outputs, to: :params

#paramsConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Structs::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.



154
155
156
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 154

def params
  @params ||= resolve_params
end

#printable_actionString

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:

  • (String)


211
212
213
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 211

def printable_action
  action.instance_of?(::Class) ? Utils::Class.display_name(action) : action.inspect
end

#printable_containerString

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:

  • (String)


202
203
204
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 202

def printable_container
  Utils::Class.display_name(container.klass)
end

#save_outputs_in_organizer!Boolean

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.



242
243
244
245
246
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 242

def save_outputs_in_organizer!
  output_values.each_pair { |key, value| organizer.internals.cache.scope(:step_output_values).write(key, value) }

  true
end

#statusConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Status



38
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 38

delegate :status, to: :result

#strict?Boolean

Returns:

  • (Boolean)


229
230
231
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 229

def strict?
  params.strict
end

#success?Boolean

Returns:

  • (Boolean)


107
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 107

delegate :success?, to: :result

#to_argsArray<Object>

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:

  • (Array<Object>)


304
305
306
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 304

def to_args
  to_arguments.args
end

#to_argumentsConveninentService::Support::Arguments

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:

  • (ConveninentService::Support::Arguments)


322
323
324
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 322

def to_arguments
  Support::Arguments.new(action, **kwargs.merge(in: inputs, out: outputs, index: index, container: container, organizer: organizer(raise_when_missing: false), **extra_kwargs))
end

#to_kwargsHash{Symbol => Object}

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:

  • (Hash{Symbol => Object})


313
314
315
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 313

def to_kwargs
  to_arguments.kwargs
end

#to_sString

Returns:

  • (String)


295
296
297
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 295

def to_s
  printable_action
end

#unsafe_codeConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Code



68
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 68

delegate :unsafe_code, to: :result

#unsafe_dataConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Data



58
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 58

delegate :unsafe_data, to: :result

#unsafe_messageConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Message



63
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 63

delegate :unsafe_message, to: :result

#with_organizer(organizer) ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step

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.



254
255
256
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 254

def with_organizer(organizer)
  copy(overrides: {kwargs: {organizer: organizer}})
end