Class: Prenus::Output::Baseout
- Inherits:
-
Object
- Object
- Prenus::Output::Baseout
- Defined in:
- lib/output/output.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(events, hosts, options) ⇒ Baseout
constructor
This is the super-class that all output classes should inherent @see Htmlout#initialize.
-
#run ⇒ Object
All inherented classes should implement a run method @see Htmlout#run.
Constructor Details
#initialize(events, hosts, options) ⇒ Baseout
This is the super-class that all output classes should inherent
@see Htmlout#initialize
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/output/output.rb', line 15 def initialize(events, hosts, ) @events = events @hosts = hosts @options = if @options[:type] == "html" #Therefore, the output should be a folder name, not a file @options[:output] = "." if @options[:output].nil? #Check if the output dir exists Dir.mkdir(@options[:output]) unless File.exists?(@options[:output]) else @oFile = File.new(@options[:output],'w') unless @options[:output].nil? @oFile = STDOUT if @oFile.nil? end end |
Instance Method Details
#run ⇒ Object
All inherented classes should implement a run method
@see Htmlout#run
37 38 39 |
# File 'lib/output/output.rb', line 37 def run end |