Class: Logripper::Exporter
- Inherits:
-
Object
- Object
- Logripper::Exporter
- Defined in:
- lib/logripper/exporter.rb
Instance Attribute Summary collapse
-
#parsed_log ⇒ Object
readonly
Returns the value of attribute parsed_log.
Instance Method Summary collapse
-
#initialize(parsed_log) ⇒ Exporter
constructor
A new instance of Exporter.
- #to_csv ⇒ Object
Constructor Details
#initialize(parsed_log) ⇒ Exporter
Returns a new instance of Exporter.
7 8 9 |
# File 'lib/logripper/exporter.rb', line 7 def initialize(parsed_log) @parsed_log = parsed_log end |
Instance Attribute Details
#parsed_log ⇒ Object (readonly)
Returns the value of attribute parsed_log.
5 6 7 |
# File 'lib/logripper/exporter.rb', line 5 def parsed_log @parsed_log end |
Instance Method Details
#to_csv ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/logripper/exporter.rb', line 11 def to_csv CSV.generate do |csv| csv << parsed_log.first.keys parsed_log.each do |log_entry| csv << log_entry.values end end end |