Class: Lines::StreamOutputter
- Inherits:
-
Object
- Object
- Lines::StreamOutputter
- Defined in:
- lib/lines.rb
Instance Method Summary collapse
-
#initialize(stream = $stderr) ⇒ StreamOutputter
constructor
stream must accept a #write(str) message.
- #output(dumper, obj) ⇒ Object
Constructor Details
#initialize(stream = $stderr) ⇒ StreamOutputter
stream must accept a #write(str) message
136 137 138 139 140 |
# File 'lib/lines.rb', line 136 def initialize(stream = $stderr) @stream = stream # Is this needed ? @stream.sync = true if @stream.respond_to?(:sync) end |
Instance Method Details
#output(dumper, obj) ⇒ Object
142 143 144 145 |
# File 'lib/lines.rb', line 142 def output(dumper, obj) str = dumper.dump(obj) + NL stream.write str end |