Method: Amp::Command#before
- Defined in:
- lib/amp/commands/command.rb
#before(*args) {|options, arguments| ... } ⇒ Hash
This returns the list of actions to run before the command, in order (first ones are run first). You can modify this array in any way you choose, and it is run before the command is run.
304 305 306 307 308 309 310 311 |
# File 'lib/amp/commands/command.rb', line 304 def before(*args, &block) args.each do |arg| @before << proc {|opts, args| Amp::Command[arg.to_sym].run(opts, args) } end @before << block if block @before end |