Class: Puppet::Util::Assertion::Printer

Inherits:
Object
  • Object
show all
Includes:
Colors
Defined in:
lib/puppet/util/assertion/printer.rb

Defined Under Namespace

Modules: Styler

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePrinter

Returns a new instance of Printer.



10
11
12
# File 'lib/puppet/util/assertion/printer.rb', line 10

def initialize
  @stack = []
end

Instance Attribute Details

#stackObject (readonly)

Returns the value of attribute stack.



8
9
10
# File 'lib/puppet/util/assertion/printer.rb', line 8

def stack
  @stack
end

Instance Method Details

#blue(msg) ⇒ Object



18
19
20
# File 'lib/puppet/util/assertion/printer.rb', line 18

def blue(msg)
  stack << colorize(:blue, msg)
end

#newlineObject



30
31
32
# File 'lib/puppet/util/assertion/printer.rb', line 30

def newline
  stack << "\n"
end

#red(msg) ⇒ Object



14
15
16
# File 'lib/puppet/util/assertion/printer.rb', line 14

def red(msg)
  stack << colorize(:red, msg)
end

#to_sObject



34
35
36
# File 'lib/puppet/util/assertion/printer.rb', line 34

def to_s
  stack.join
end

#white(msg) ⇒ Object



26
27
28
# File 'lib/puppet/util/assertion/printer.rb', line 26

def white(msg)
  stack << msg
end

#yellow(msg) ⇒ Object



22
23
24
# File 'lib/puppet/util/assertion/printer.rb', line 22

def yellow(msg)
  stack << colorize(:yellow, msg)
end