Module: CommandKit::Commands::ParentCommand
Overview
Allows a command to be aware of it's parent command.
Instance Attribute Summary collapse
-
#parent_command ⇒ Object<Commands>
readonly
The parent command instance.
Instance Method Summary collapse
-
#initialize(parent_command:, **kwargs) ⇒ Object
Initializes the command and sets #parent_command.
Instance Attribute Details
#parent_command ⇒ Object<Commands> (readonly)
The parent command instance.
15 16 17 |
# File 'lib/command_kit/commands/parent_command.rb', line 15 def parent_command @parent_command end |
Instance Method Details
#initialize(parent_command:, **kwargs) ⇒ Object
Initializes the command and sets #parent_command.
22 23 24 25 26 |
# File 'lib/command_kit/commands/parent_command.rb', line 22 def initialize(parent_command: , **kwargs) @parent_command = parent_command super(**kwargs) end |