Method: Cork::Board#initialize

Defined in:
lib/cork/board.rb

#initialize(verbose: false, silent: false, ansi: true, input: $stdin, out: $stdout, err: $stderr) ⇒ Board

Initialize a new instance.

Parameters:

  • verbose (Boolean) (defaults to: false)

    When verbose is true verbose output is printed. this defaults to true

  • silent (Boolean) (defaults to: false)

    When silent is true all output is supressed. This defaults to false.

  • ansi (Boolean) (defaults to: true)

    When ansi is true output may contain ansi color codes. This is true by default.

  • input (IO) (defaults to: $stdin)

    The file descriptor to read the user input.

  • out (IO) (defaults to: $stdout)

    The file descriptor to print all output to.

  • err (IO) (defaults to: $stderr)

    The file descriptor to print all errors to.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/cork/board.rb', line 49

def initialize(verbose: false, silent: false, ansi: true,
  input: $stdin, out: $stdout, err: $stderr)

  @input = input
  @out = out
  @err = err
  @verbose = verbose
  @silent = silent
  @ansi = ansi
  @warnings = []
  @title_colors      =  %w(    yellow green    )
  @title_level       =  0
  @indentation_level =  2
end