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.
13 14 15 |
# File 'lib/command_kit/commands/parent_command.rb', line 13 def parent_command @parent_command end |
Instance Method Details
#initialize(parent_command:, **kwargs) ⇒ Object
Initializes the command and sets #parent_command.
20 21 22 23 24 |
# File 'lib/command_kit/commands/parent_command.rb', line 20 def initialize(parent_command: , **kwargs) @parent_command = parent_command super(**kwargs) end |