Module: ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Concern::InstanceMethods
- Includes:
- ConvenientService::Support::Delegate
- Defined in:
- lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb
Instance Attribute Summary collapse
-
#caller ⇒ Object
readonly
Returns the value of attribute caller.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Boolean?
-
#define_output_in_container!(container, index:) ⇒ Boolean
True if method is just defined, false if already defined.
- #has_organizer? ⇒ Boolean
- #initialize(key:, name:, caller:, direction:, organizer: nil) ⇒ void
- #organizer(raise_when_missing: true) ⇒ ConvenientService::Service?
- #to_arguments ⇒ ConvenientService::Support::Arguments
- #to_kwargs ⇒ Hash{Symbol => Object}
- #to_s ⇒ String
-
#value ⇒ Object
Can be any type.
Methods included from ConvenientService::Support::Delegate::ClassMethodsForForwardable
Instance Attribute Details
#caller ⇒ Object (readonly)
Returns the value of attribute caller.
29 30 31 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 29 def caller @caller end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
35 36 37 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 35 def direction @direction end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
17 18 19 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 17 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
23 24 25 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 23 def name @name end |
Instance Method Details
#==(other) ⇒ Boolean?
101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 101 def ==(other) return unless other.instance_of?(self.class) return false if key != other.key return false if name != other.name return false if caller != other.caller return false if direction != other.direction return false if organizer(raise_when_missing: false) != other.organizer(raise_when_missing: false) true end |
#define_output_in_container!(container, index:) ⇒ Boolean
Returns true if method is just defined, false if already defined.
91 92 93 94 95 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 91 def define_output_in_container!(container, index:) direction.define_output_in_container!(container, index: index, method: self) caller.define_output_in_container!(container, index: index, method: self) end |
#has_organizer? ⇒ Boolean
79 80 81 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 79 def has_organizer? Utils.to_bool(organizer(raise_when_missing: false)) end |
#initialize(key:, name:, caller:, direction:, organizer: nil) ⇒ void
50 51 52 53 54 55 56 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 50 def initialize(key:, name:, caller:, direction:, organizer: nil) @key = key @name = name @caller = caller @direction = direction @organizer = organizer end |
#organizer(raise_when_missing: true) ⇒ ConvenientService::Service?
63 64 65 66 67 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 63 def organizer(raise_when_missing: true) ::ConvenientService.raise Exceptions::MethodHasNoOrganizer.new(method: self) if @organizer.nil? && raise_when_missing @organizer end |
#to_arguments ⇒ ConvenientService::Support::Arguments
123 124 125 126 127 128 129 130 131 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 123 def to_arguments Support::Arguments.new( key: key, name: name, caller: caller, direction: direction, organizer: organizer(raise_when_missing: false) ) end |
#to_kwargs ⇒ Hash{Symbol => Object}
116 117 118 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 116 def to_kwargs to_arguments.kwargs end |
#to_s ⇒ String
40 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 40 delegate :to_s, to: :name |
#value ⇒ Object
Returns Can be any type.
72 73 74 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb', line 72 def value @value ||= caller.calculate_value(self) end |