Module: ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Concern::InstanceMethods
- Defined in:
- lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb
Instance Method Summary collapse
- #==(other) ⇒ Boolean? private
- #code ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Code
- #container ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service
- #data ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Data
- #define! ⇒ void private
- #error? ⇒ Boolean
- #extra_kwargs ⇒ Hash{Symbol => Object}
- #failure? ⇒ Boolean
- #has_organizer? ⇒ Boolean private
- #has_reassignment?(name) ⇒ Boolean
- #index ⇒ Integer
- #initialize(*args, **kwargs) ⇒ void private
- #input_values ⇒ Hash{Symbol => Object}
- #inputs ⇒ Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method>
- #message ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Message
- #not_error? ⇒ Boolean
- #not_failure? ⇒ Boolean
- #not_success? ⇒ Boolean
- #organizer(raise_when_missing: true) ⇒ ConvenientService::Service private
- #output_values ⇒ Hash{Symbol => Object}
- #outputs ⇒ Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method>
- #params ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step::Structs::Params private
- #printable_container ⇒ String private
- #printable_service ⇒ String private
- #reassignment(name) ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method?
- #save_outputs_in_organizer! ⇒ Boolean private
- #service ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service
- #service_class ⇒ Class private
- #service_result ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result private
- #status ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Status
- #success? ⇒ Boolean
- #to_args ⇒ Array<Object> private
- #to_arguments ⇒ ConveninentService::Support::Arguments private
- #to_kwargs ⇒ Hash{Symbol => Object} private
- #to_s ⇒ String
- #trigger_callback ⇒ void private
- #unsafe_code ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Code
- #unsafe_data ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Data
- #unsafe_message ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Message
- #validate! ⇒ void private
- #with_organizer(organizer) ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Step private
Methods included from ConvenientService::Support::Concern
Methods included from ConvenientService::Support::Copyable
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.
325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 325 def ==(other) return unless other.instance_of?(self.class) return false if service != other.service 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 |
#code ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Code
36 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 36 delegate :code, to: :result |
#container ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service
77 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 77 delegate :container, to: :params |
#data ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Data
26 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 26 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.
313 314 315 316 317 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 313 def define! outputs.each { |output| output.define_output_in_container!(container, index: index) } true end |
#error? ⇒ Boolean
97 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 97 delegate :error?, to: :result |
#extra_kwargs ⇒ Hash{Symbol => Object}
82 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 82 delegate :extra_kwargs, to: :params |
#failure? ⇒ Boolean
92 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 92 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.
245 246 247 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 245 def has_organizer? Utils.to_bool(organizer(raise_when_missing: false)) end |
#has_reassignment?(name) ⇒ Boolean
255 256 257 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 255 def has_reassignment?(name) outputs.any? { |output| output.reassignment?(name) } end |
#index ⇒ Integer
72 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 72 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.
121 122 123 124 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 121 def initialize(*args, **kwargs) @args = args @kwargs = kwargs end |
#input_values ⇒ Hash{Symbol => Object}
172 173 174 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 172 def input_values @input_values ||= calculate_input_values end |
#inputs ⇒ Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method>
162 163 164 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 162 def inputs @inputs ||= params.inputs.map { |input| input.copy(overrides: {kwargs: {organizer: organizer(raise_when_missing: false)}}) } end |
#message ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Message
31 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 31 delegate :message, to: :result |
#not_error? ⇒ Boolean
112 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 112 delegate :not_error?, to: :result |
#not_failure? ⇒ Boolean
107 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 107 delegate :not_failure?, to: :result |
#not_success? ⇒ Boolean
102 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 102 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.
149 150 151 152 153 154 155 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 149 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_values ⇒ Hash{Symbol => Object}
182 183 184 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 182 def output_values @output_values ||= calculate_output_values end |
#outputs ⇒ Array<ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method>
67 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 67 delegate :outputs, to: :params |
#params ⇒ ConvenientService::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.
134 135 136 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 134 def params @params ||= resolve_params end |
#printable_container ⇒ String
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.
201 202 203 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 201 def printable_container Utils::Class.display_name(container.klass) end |
#printable_service ⇒ String
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.
210 211 212 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 210 def printable_service Utils::Class.display_name(service.klass) end |
#reassignment(name) ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method?
192 193 194 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 192 def reassignment(name) outputs.find { |output| output.reassignment?(name) } 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.
278 279 280 281 282 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 278 def save_outputs_in_organizer! output_values.each_pair { |key, value| organizer.internals.cache.scope(:step_output_values).write(key, value) } true end |
#service ⇒ ConvenientService::Service::Plugins::CanHaveSteps::Entities::Service
59 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 59 delegate :service, to: :params |
#service_class ⇒ Class
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.
236 237 238 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 236 def service_class service.klass end |
#service_result ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result
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.
‘service_result` has middlewares.
227 228 229 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 227 def service_result @service_result ||= service.klass.result(**input_values) end |
#status ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Status
21 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 21 delegate :status, to: :result |
#success? ⇒ Boolean
87 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 87 delegate :success?, to: :result |
#to_args ⇒ Array<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.
354 355 356 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 354 def to_args to_arguments.args end |
#to_arguments ⇒ ConveninentService::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.
372 373 374 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 372 def to_arguments Support::Arguments.new(service, **kwargs.merge(in: inputs, out: outputs, index: index, container: container, organizer: organizer(raise_when_missing: false), **extra_kwargs)) end |
#to_kwargs ⇒ Hash{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.
363 364 365 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 363 def to_kwargs to_arguments.kwargs end |
#to_s ⇒ String
345 346 347 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 345 def to_s printable_service end |
#trigger_callback ⇒ 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.
265 266 267 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 265 def trigger_callback organizer.step(index) end |
#unsafe_code ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Code
51 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 51 delegate :unsafe_code, to: :result |
#unsafe_data ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Data
41 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 41 delegate :unsafe_data, to: :result |
#unsafe_message ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result::Plugins::HasJSendStatusAndAttributes::Entities::Message
46 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 46 delegate :unsafe_message, to: :result |
#validate! ⇒ 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.
300 301 302 303 304 305 306 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 300 def validate! inputs.each { |input| input.validate_as_input_for_container!(container) } outputs.each { |output| output.validate_as_output_for_container!(container) } true end |
#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.
290 291 292 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb', line 290 def with_organizer(organizer) copy(overrides: {kwargs: {organizer: organizer}}) end |