Class: Polars::Command
- Inherits:
-
Object
- Object
- Polars::Command
- Defined in:
- lib/polars/system.rb
Overview
Command Class
Instance Attribute Summary collapse
-
#command_line ⇒ Object
readonly
Returns the value of attribute command_line.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#exit_status ⇒ Object
readonly
Returns the value of attribute exit_status.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(command) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
Constructor Details
#initialize(command) ⇒ Command
Returns a new instance of Command.
25 26 27 |
# File 'lib/polars/system.rb', line 25 def initialize(command) @command = command end |
Instance Attribute Details
#command_line ⇒ Object (readonly)
Returns the value of attribute command_line.
39 40 41 |
# File 'lib/polars/system.rb', line 39 def command_line @command_line end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
41 42 43 |
# File 'lib/polars/system.rb', line 41 def error @error end |
#exit_status ⇒ Object (readonly)
Returns the value of attribute exit_status.
38 39 40 |
# File 'lib/polars/system.rb', line 38 def exit_status @exit_status end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
40 41 42 |
# File 'lib/polars/system.rb', line 40 def output @output end |
Instance Method Details
#run ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/polars/system.rb', line 29 def run result = AwesomeSpawn.run(@command) @exit_status = result.exit_status @command_line = result.command_line @output = result.output @error = result.error @exit_status end |