Class: Action
- Inherits:
-
Object
- Object
- Action
- 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
-
#initialize(command, args) ⇒ Action
constructor
A new instance of Action.
- #run ⇒ Object
- #to_s ⇒ Object
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
#run ⇒ Object
11 12 13 |
# File 'lib/action.rb', line 11 def run Kernel.exec(to_s) end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/action.rb', line 15 def to_s "#{@command} #{@args.join(' ')}" end |