Sha256: 4ee827cbefe48ae3751bedb0cabeb2a9b907aee6b4de4e6ad5bd4c4e6d68740e
Contents?: true
Size: 991 Bytes
Versions: 12
Compression:
Stored size: 991 Bytes
Contents
# frozen_string_literal: true module HoneyFormat # CLI result writer handles command output # @attr_reader [true, false] verbose the writer mode class CLIResultWriter attr_accessor :verbose # Instantiate the result writer # @param verbose [true, false] mode (default: false) # @return [CLIResultWriter] the result writer def initialize(verbose: false) @verbose = verbose end # Return if verbose mode is true/false # @return [true, false] def verbose? @verbose end # Print the string # @param [String] string to print # @param verbose [true, false] mode (default: false) def print(string, verbose: false) return if !verbose? && verbose Kernel.print(string) end # Puts the string # @param [String] string to puts # @param verbose [true, false] mode (default: false) def puts(string, verbose: false) return if !verbose? && verbose Kernel.puts(string) end end end
Version data entries
12 entries across 12 versions & 1 rubygems