Class: Peastash::Outputs::IO
- Inherits:
-
Object
- Object
- Peastash::Outputs::IO
- Defined in:
- lib/peastash/outputs/io.rb
Constant Summary collapse
- @@default_io =
STDOUT
Class Method Summary collapse
Instance Method Summary collapse
- #dump(event) ⇒ Object
-
#initialize(file) ⇒ IO
constructor
A new instance of IO.
Constructor Details
#initialize(file) ⇒ IO
Returns a new instance of IO.
12 13 14 |
# File 'lib/peastash/outputs/io.rb', line 12 def initialize(file) @device = Logger::LogDevice.new(file) end |
Class Method Details
.default_io ⇒ Object
8 9 10 |
# File 'lib/peastash/outputs/io.rb', line 8 def self.default_io @@default_io end |
Instance Method Details
#dump(event) ⇒ Object
16 17 18 |
# File 'lib/peastash/outputs/io.rb', line 16 def dump(event) @device.write(event.to_json + "\n") end |