Module: IIRC::PrintIO
- Defined in:
- lib/iirc/modules/print_io.rb
Overview
Wraps Reading#lines and Bot#<< to print lines received and sent to stdout. Useful for debugging.
Instance Method Summary collapse
-
#<<(line) ⇒ self
Prints
<< #{line}
to stdout, then calls super. -
#lines ⇒ Object
Prints
>> #{line}
to stdout, then yields, for each line from super.
Instance Method Details
#<<(line) ⇒ self
Prints << #{line}
to stdout, then calls super
12 13 14 15 |
# File 'lib/iirc/modules/print_io.rb', line 12 def <<(line) puts "<< #{line}" super end |
#lines ⇒ Object
Prints >> #{line}
to stdout, then yields, for each line from super.
6 7 8 |
# File 'lib/iirc/modules/print_io.rb', line 6 def lines super { |line| puts ">> #{line}"; yield line } end |