Module: CommandKit::Commands::ParentCommand

Included in:
Command, Help
Defined in:
lib/command_kit/commands/parent_command.rb

Overview

Allows a command to be aware of it's parent command.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#parent_commandObject<Commands> (readonly)

The parent command instance.

Returns:



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