class Pug::HelpAction

Lists all the system defined actions

Public Class Methods

new(actions) click to toggle source

@param actions [Array<Interfaces::Action>]

system provided actions
# File lib/pug/help_action.rb, line 8
def initialize(actions)
  @actions = actions
end

Public Instance Methods

execute() click to toggle source

Override of {Interfaces::Action#execute} @return [String]

# File lib/pug/help_action.rb, line 22
def execute
  return Strings.no_help_commands if @actions.empty?
  actions = @actions.map do |action|
    if action.description.to_s.empty?
      action.name
    else
      "#{action.name} # #{action.description}"
    end
  end
  Strings.help(actions.join("\n"))
end
name() click to toggle source

Override of {Interfaces::Action#name} @return [String]

# File lib/pug/help_action.rb, line 16
def name
  ''
end