class Luban::CLI::Command
Attributes
command_chain[R]
name[R]
Public Class Methods
new(parent, name, command_chain: [name], **opts, &config_blk)
click to toggle source
Calls superclass method
Luban::CLI::Base::new
# File lib/luban/cli/command.rb, line 7 def initialize(parent, name, command_chain: [name], **opts, &config_blk) @name = name @command_chain = command_chain super(parent, name, **opts, &config_blk) end
Public Instance Methods
action_method()
click to toggle source
# File lib/luban/cli/command.rb, line 15 def action_method @action_method ||= "#{@prefix}#{command_chain.map(&:to_s).join('_').gsub(':', '_')}" end
command(cmd, **opts, &blk)
click to toggle source
Calls superclass method
Luban::CLI::Base#command
# File lib/luban/cli/command.rb, line 19 def command(cmd, **opts, &blk) opts[:command_chain] = self.command_chain.clone.push(cmd) super end
default_prefix()
click to toggle source
# File lib/luban/cli/command.rb, line 13 def default_prefix; '__command_'; end