Class: Puppet::Util::Assertion::Printer
- Inherits:
-
Object
- Object
- Puppet::Util::Assertion::Printer
- Includes:
- Colors
- Defined in:
- lib/puppet/util/assertion/printer.rb
Defined Under Namespace
Modules: Styler
Instance Attribute Summary collapse
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
Instance Method Summary collapse
- #blue(msg) ⇒ Object
-
#initialize ⇒ Printer
constructor
A new instance of Printer.
- #newline ⇒ Object
- #red(msg) ⇒ Object
- #to_s ⇒ Object
- #white(msg) ⇒ Object
- #yellow(msg) ⇒ Object
Constructor Details
#initialize ⇒ Printer
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
#stack ⇒ Object (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 |
#newline ⇒ Object
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_s ⇒ Object
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 |