Class: CandyCheck::CLI::Out
- Inherits:
-
Object
- Object
- CandyCheck::CLI::Out
- Defined in:
- lib/candy_check/cli/out.rb
Overview
A wrapper to output text information to any kind of buffer
Instance Attribute Summary collapse
-
#out ⇒ Object
readonly
Buffer used as default outlet.
Instance Method Summary collapse
-
#initialize(out = $stdout) ⇒ Out
constructor
Bind a new out instance to two buffers.
-
#pretty(object) ⇒ Object
Pretty print an object to
out
. -
#print(text = "") ⇒ Object
Prints to
out
.
Constructor Details
#initialize(out = $stdout) ⇒ Out
Bind a new out instance to two buffers
13 14 15 |
# File 'lib/candy_check/cli/out.rb', line 13 def initialize(out = $stdout) @out = out end |
Instance Attribute Details
#out ⇒ Object (readonly)
Returns buffer used as default outlet.
9 10 11 |
# File 'lib/candy_check/cli/out.rb', line 9 def out @out end |
Instance Method Details
#pretty(object) ⇒ Object
Pretty print an object to out
25 26 27 |
# File 'lib/candy_check/cli/out.rb', line 25 def pretty(object) PP.pp(object, out) end |
#print(text = "") ⇒ Object
Prints to out
19 20 21 |
# File 'lib/candy_check/cli/out.rb', line 19 def print(text = "") out.puts text end |