Class: Hallmonitor::Outputters::IOOutputter
- Inherits:
-
Hallmonitor::Outputter
- Object
- Hallmonitor::Outputter
- Hallmonitor::Outputters::IOOutputter
- Defined in:
- lib/hallmonitor/outputters/iooutputter.rb
Overview
Simple outputter that just prints to an output stream
Instance Attribute Summary
Attributes inherited from Hallmonitor::Outputter
Instance Method Summary collapse
-
#initialize(name, out) ⇒ IOOutputter
constructor
Builds a new IOOutputter.
-
#process(event) ⇒ Object
Sends an event to the configured output on IOError the output will be closed.
Constructor Details
#initialize(name, out) ⇒ IOOutputter
Builds a new IOOutputter
11 12 13 14 |
# File 'lib/hallmonitor/outputters/iooutputter.rb', line 11 def initialize(name, out) super(name) @out = out end |
Instance Method Details
#process(event) ⇒ Object
Sends an event to the configured output on IOError the output will be closed
18 19 20 21 22 23 24 25 |
# File 'lib/hallmonitor/outputters/iooutputter.rb', line 18 def process(event) begin @out.print "EVENT: #{event.to_json}\n" @out.flush rescue IOError => e close end end |