Class: ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Commands::DefineMethodInContainer Private
- Inherits:
-
ConvenientService::Support::Command
- Object
- ConvenientService::Support::Command
- ConvenientService::Service::Plugins::CanHaveSteps::Entities::Method::Commands::DefineMethodInContainer
- Includes:
- ConvenientService::Support::Delegate
- Defined in:
- lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #container ⇒ Object readonly private
- #index ⇒ Object readonly private
- #method ⇒ Object readonly private
Instance Method Summary collapse
-
#call ⇒ Boolean
private
True if method is just defined, false if already defined.
- #initialize(method:, container:, index:) ⇒ void constructor private
Methods included from ConvenientService::Support::Delegate::ClassMethodsForForwardable
Methods included from ConvenientService::Support::Concern
Methods inherited from ConvenientService::Support::Command
Constructor Details
#initialize(method:, container:, index:) ⇒ 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.
42 43 44 45 46 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb', line 42 def initialize(method:, container:, index:) @method = method @container = container @index = index end |
Instance Attribute Details
#container ⇒ Object (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.
28 29 30 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb', line 28 def container @container end |
#index ⇒ Object (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.
34 35 36 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb', line 34 def index @index end |
#method ⇒ Object (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.
22 23 24 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb', line 22 def method @method end |
Instance Method Details
#call ⇒ 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 true if method is just defined, false if already defined.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb', line 51 def call container.lock.synchronize do return false if has_defined_method? define_alias_method define_method true end end |