Class: Umarell::Command
- Inherits:
-
Object
- Object
- Umarell::Command
- Defined in:
- lib/umarell/command.rb
Overview
The class responsible for running commands
Instance Method Summary collapse
-
#initialize(name, arguments = []) ⇒ Command
constructor
A new instance of Command.
-
#run ⇒ Object
Run the command.
- #to_s ⇒ Object
Constructor Details
#initialize(name, arguments = []) ⇒ Command
Returns a new instance of Command.
6 7 8 9 |
# File 'lib/umarell/command.rb', line 6 def initialize(name, arguments = []) @name = name @arguments = arguments end |
Instance Method Details
#run ⇒ Object
Run the command
12 13 14 |
# File 'lib/umarell/command.rb', line 12 def run system "echo '#{header}'; #{self}; echo '#{}'" end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/umarell/command.rb', line 16 def to_s "#{@name} #{@arguments.join(' ')}" end |