Class: Threatinator::FileBasedOutput
- Defined in:
- lib/threatinator/output.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Config
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(config) ⇒ FileBasedOutput
constructor
A new instance of FileBasedOutput.
Methods inherited from Output
Constructor Details
#initialize(config) ⇒ FileBasedOutput
Returns a new instance of FileBasedOutput.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/threatinator/output.rb', line 28 def initialize(config) super(config) if io = config.io @output_io = io elsif filename = config.filename @output_io = File.open(filename, 'w:UTF-8') else @output_io = $stdout.dup end end |
Instance Method Details
#finish ⇒ Object
39 40 41 |
# File 'lib/threatinator/output.rb', line 39 def finish @output_io.close end |