class Pug::ListAction

Lists all the user defined actions

Public Class Methods

new(actions) click to toggle source

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

user provided actions
# File lib/pug/list_action.rb, line 8
def initialize(actions)
  @actions = actions
  @enumerator = Action::Enumerator.new
end

Public Instance Methods

description() click to toggle source

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

# File lib/pug/list_action.rb, line 23
def description
  Strings.list_description
end
execute() click to toggle source

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

# File lib/pug/list_action.rb, line 29
def execute
  return Strings.no_actions if @actions.empty?
  @enumerator.names(@actions, true).join("\n")
end
name() click to toggle source

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

# File lib/pug/list_action.rb, line 17
def name
  'list'
end