Class: Dicey::CLI::VerbosePrinter Private
- Inherits:
-
Object
- Object
- Dicey::CLI::VerbosePrinter
- Defined in:
- lib/dicey/cli/verbose_printer.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Prints verbose output to the given IO object.
Instance Method Summary collapse
-
#initialize(verbosity, io = $stdout) ⇒ VerbosePrinter
constructor
private
A new instance of VerbosePrinter.
-
#print(message, min_verbosity = 1) ⇒ Object
private
Prints the given message to the IO object if the verbosity level is greater than or equal to the minimum verbosity level.
Constructor Details
#initialize(verbosity, io = $stdout) ⇒ VerbosePrinter
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of VerbosePrinter.
7 8 9 10 |
# File 'lib/dicey/cli/verbose_printer.rb', line 7 def initialize(verbosity, io = $stdout) @verbosity = verbosity || 0 @io = io end |
Instance Method Details
#print(message, min_verbosity = 1) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Prints the given message to the IO object if the verbosity level is greater than or equal to the minimum verbosity level.
17 18 19 |
# File 'lib/dicey/cli/verbose_printer.rb', line 17 def print(, min_verbosity = 1) @io.puts if @verbosity >= min_verbosity end |