Class: CMD
- Inherits:
-
Hash
- Object
- Hash
- CMD
- Defined in:
- lib/cmd.rb
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(cmd, options = nil) ⇒ CMD
constructor
A new instance of CMD.
Constructor Details
#initialize(cmd, options = nil) ⇒ CMD
9 10 11 12 13 14 15 16 17 |
# File 'lib/cmd.rb', line 9 def initialize(cmd, =nil) initialize_defaults if(.nil?) self[:output] = '' self[:error] = '' .each { |key, value| self[key] = value} .each { |key, value| self[key] = value} unless(.nil?) self[:command]=cmd end |
Class Method Details
.default_options(hash) ⇒ Object
20 21 22 |
# File 'lib/cmd.rb', line 20 def self.(hash) hash.each { |key, value| [key] = value} end |
Instance Method Details
#execute ⇒ Object
24 25 26 |
# File 'lib/cmd.rb', line 24 def execute windows_command(self, self[:command]) end |