class HoneyFormat::CLIResultWriter
CLI
result writer handles command output @attr_reader [true, false] verbose the writer mode
Attributes
verbose[RW]
Public Class Methods
new(verbose: false)
click to toggle source
Instantiate the result writer @param verbose [true, false] mode (default: false) @return [CLIResultWriter] the result writer
# File lib/honey_format/cli/result_writer.rb, line 12 def initialize(verbose: false) @verbose = verbose end
Public Instance Methods
print(string, verbose: false)
click to toggle source
Print the string @param [String] string to print @param verbose [true, false] mode (default: false)
# File lib/honey_format/cli/result_writer.rb, line 25 def print(string, verbose: false) return if !verbose? && verbose Kernel.print(string) end
puts(string, verbose: false)
click to toggle source
Puts the string @param [String] string to puts @param verbose [true, false] mode (default: false)
# File lib/honey_format/cli/result_writer.rb, line 34 def puts(string, verbose: false) return if !verbose? && verbose Kernel.puts(string) end
verbose?()
click to toggle source
Return if verbose mode is true/false @return [true, false]
# File lib/honey_format/cli/result_writer.rb, line 18 def verbose? @verbose end