Class: ConvenientService::Service::Plugins::CanHaveStepAwareEnumerables::Entities::StepAwareEnumerables::Base

Inherits:
Object
  • Object
show all
Includes:
ConvenientService::Support::AbstractMethod
Defined in:
lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/base.rb

Direct Known Subclasses

Enumerable, Object

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ConvenientService::Support::AbstractMethod

abstract_method

Constructor Details

#initialize(object:, organizer:, propagated_result:) ⇒ 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:



90
91
92
93
94
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/base.rb', line 90

def initialize(object:, organizer:, propagated_result:)
  @object = object
  @organizer = organizer
  @propagated_result = propagated_result
end

Instance Attribute Details

#objectObject (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.



23
24
25
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/base.rb', line 23

def object
  @object
end

#organizerObject (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.



31
32
33
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/base.rb', line 31

def organizer
  @organizer
end

#propagated_resultObject (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.



39
40
41
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/base.rb', line 39

def propagated_result
  @propagated_result
end

Instance Method Details

#==(other) ⇒ Boolean?

Parameters:

  • other (Object)

    Can be any type.

Returns:



111
112
113
114
115
116
117
118
119
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/base.rb', line 111

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

  return false if object != other.object
  return false if organizer != other.organizer
  return false if propagated_result != other.propagated_result

  true
end

#default_data_keySymbol?

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:

  • (Symbol, nil)


46
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/base.rb', line 46

abstract_method :default_data_key

#evaluate_bySymbol, ...

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:

  • (Symbol, String, Proc, nil)


53
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/base.rb', line 53

abstract_method :evaluate_by

#result(data_key: default_data_key, evaluate_by: default_evaluate_by) ⇒ ConvenientService::Service::Plugins::HasJSendResult::Entities::Result

Parameters:

  • data_key (Symbol, nil) (defaults to: default_data_key)
  • evaluate_by (String, Symbol, Proc) (defaults to: default_evaluate_by)

Returns:



101
102
103
104
105
# File 'lib/convenient_service/service/plugins/can_have_step_aware_enumerables/entities/step_aware_enumerables/base.rb', line 101

def result(data_key: default_data_key, evaluate_by: default_evaluate_by)
  with_propagated_result_returning(evaluate_by) do |values|
    data_key ? success(data_key => values) : success
  end
end