Class: Ruboclean::Runner::Options::Output
- Inherits:
-
Object
- Object
- Ruboclean::Runner::Options::Output
- Defined in:
- lib/ruboclean/runner/options/output.rb
Overview
Determines the output stream
Instance Method Summary collapse
-
#initialize(cli_arguments:, input:) ⇒ Output
constructor
A new instance of Output.
- #stdout? ⇒ Boolean
- #stream ⇒ Object
Constructor Details
#initialize(cli_arguments:, input:) ⇒ Output
Returns a new instance of Output.
8 9 10 11 |
# File 'lib/ruboclean/runner/options/output.rb', line 8 def initialize(cli_arguments:, input:) @cli_arguments = cli_arguments @input = input end |
Instance Method Details
#stdout? ⇒ Boolean
17 18 19 20 |
# File 'lib/ruboclean/runner/options/output.rb', line 17 def stdout? (cli_arguments.output.nil? && input.stdin?) || cli_arguments.output == "STDOUT" end |
#stream ⇒ Object
13 14 15 |
# File 'lib/ruboclean/runner/options/output.rb', line 13 def stream @stream ||= determine_output_stream end |