Class: Action

Inherits:
Object
  • Object
show all
Defined in:
lib/action.rb

Overview

represents one action to be performed in the shell can assemble a command line from a command and args

Instance Method Summary collapse

Constructor Details

#initialize(command, args) ⇒ Action

Returns a new instance of Action.



6
7
8
9
# File 'lib/action.rb', line 6

def initialize(command, args)
	@command = command
	@args = args
end

Instance Method Details

#runObject



11
12
13
# File 'lib/action.rb', line 11

def run
	Kernel.exec(to_s)
end

#to_sObject



15
16
17
# File 'lib/action.rb', line 15

def to_s
	"#{@command} #{@args.join(' ')}"
end