Class: CemAcpt::Utils::Shell::OutputData
- Inherits:
-
Object
- Object
- CemAcpt::Utils::Shell::OutputData
- Defined in:
- lib/cem_acpt/utils/shell.rb
Overview
Class to represent a single piece of output data, along with the stream it came from (stdout or stderr). This class is used to buffer output data from shell commands before writing it to the output stream, allowing for real-time logging and processing of the output.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
-
#initialize(data, stream = :stdout) ⇒ OutputData
constructor
Initializes a new OutputData instance.
-
#to_s ⇒ String
The string representation of the output data, which is just the data itself.
Constructor Details
#initialize(data, stream = :stdout) ⇒ OutputData
Initializes a new OutputData instance.
23 24 25 26 |
# File 'lib/cem_acpt/utils/shell.rb', line 23 def initialize(data, stream = :stdout) @data = data @stream = stream end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
18 19 20 |
# File 'lib/cem_acpt/utils/shell.rb', line 18 def data @data end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
18 19 20 |
# File 'lib/cem_acpt/utils/shell.rb', line 18 def stream @stream end |
Instance Method Details
#to_s ⇒ String
Returns The string representation of the output data, which is just the data itself.
29 30 31 |
# File 'lib/cem_acpt/utils/shell.rb', line 29 def to_s data end |