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.


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

def args
  @args
end

#kwargsObject (readonly)

Returns the value of attribute kwargs.


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

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)
[View source]

264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 264

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

[View source]

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

delegate :action, to: :params

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

[View source]

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

delegate :code, to: :result

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

[View source]

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

delegate :container, to: :params

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

[View source]

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

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.

[View source]

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

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

  true
end

#error?Boolean

Returns:

  • (Boolean)
[View source]

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

delegate :error?, to: :result

#extra_kwargsHash{Symbol => Object}

Returns:

  • (Hash{Symbol => Object})
[View source]

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

delegate :extra_kwargs, to: :params

#failure?Boolean

Returns:

  • (Boolean)
[View source]

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

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)
[View source]

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

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

#indexInteger

Returns:

  • (Integer)
[View source]

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

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})
[View source]

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

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

#input_valuesHash{Symbol => Object}

[View source]

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

def input_values
  @input_values ||= calculate_input_values
end

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

[View source]

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

def inputs
  @inputs ||= params.inputs.map { |input| input.copy(overrides: {kwargs: {organizer: organizer(raise_when_missing: false)}}) }
end

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

[View source]

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

delegate :message, to: :result

#not_error?Boolean

Returns:

  • (Boolean)
[View source]

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

delegate :not_error?, to: :result

#not_failure?Boolean

Returns:

  • (Boolean)
[View source]

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

delegate :not_failure?, to: :result

#not_success?Boolean

Returns:

  • (Boolean)
[View source]

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

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.

[View source]

158
159
160
161
162
163
164
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 158

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:

[View source]

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

def output_values
  @output_values ||= calculate_output_values
end

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

[View source]

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

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.

[View source]

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

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)
[View source]

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

def printable_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)
[View source]

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

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.

[View source]

231
232
233
234
235
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 231

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

[View source]

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

delegate :status, to: :result

#success?Boolean

Returns:

  • (Boolean)
[View source]

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

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>)
[View source]

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

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)
[View source]

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

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})
[View source]

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

def to_kwargs
  to_arguments.kwargs
end

#to_sString

Returns:

  • (String)
[View source]

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

def to_s
  printable_action
end

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

[View source]

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

delegate :unsafe_code, to: :result

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

[View source]

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

delegate :unsafe_data, to: :result

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

[View source]

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

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.

[View source]

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

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