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
10 11 12 13 |
# File 'lib/hallmonitor/outputters/iooutputter.rb', line 10 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
17 18 19 20 21 22 |
# File 'lib/hallmonitor/outputters/iooutputter.rb', line 17 def process(event) @out.print "EVENT: #{event.to_json}\n" @out.flush rescue IOError close end |