Class: ShellCommand::Command
- Inherits:
-
Struct
- Object
- Struct
- ShellCommand::Command
- Defined in:
- lib/shell_command.rb
Instance Attribute Summary collapse
-
#status ⇒ Process::Status
The status of the command.
-
#stderr ⇒ String
The output written by the command to standard error.
-
#stdout ⇒ String
The output written by the command to standard output.
Instance Method Summary collapse
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to_missing?(method, include_private = false) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/shell_command.rb', line 21 def method_missing method, *args, &block if status.respond_to?(method) status.send(method, *args, &block) else super end end |
Instance Attribute Details
#status ⇒ Process::Status
The status of the command.
19 20 21 |
# File 'lib/shell_command.rb', line 19 def status @status end |
#stderr ⇒ String
The output written by the command to standard error.
19 20 21 |
# File 'lib/shell_command.rb', line 19 def stderr @stderr end |
#stdout ⇒ String
The output written by the command to standard output.
19 20 21 |
# File 'lib/shell_command.rb', line 19 def stdout @stdout end |
Instance Method Details
#respond_to_missing?(method, include_private = false) ⇒ Boolean
29 30 31 |
# File 'lib/shell_command.rb', line 29 def respond_to_missing? method, include_private = false status.respond_to?(method, include_private) end |