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
15 16 17 |
# File 'lib/candy_check/cli/out.rb', line 15 def initialize(out = $stdout) @out = out end |
Instance Attribute Details
#out ⇒ Object (readonly)
Returns buffer used as default outlet.
11 12 13 |
# File 'lib/candy_check/cli/out.rb', line 11 def out @out end |
Instance Method Details
#pretty(object) ⇒ Object
Pretty print an object to out
27 28 29 |
# File 'lib/candy_check/cli/out.rb', line 27 def pretty(object) PP.pp(object, out) end |
#print(text = '') ⇒ Object
Prints to out
21 22 23 |
# File 'lib/candy_check/cli/out.rb', line 21 def print(text = '') out.puts text end |