Class: GmailExtractor::FilePrinter

Inherits:
Object
  • Object
show all
Defined in:
lib/gmail_extractor/printer/file_printer.rb

Instance Method Summary collapse

Constructor Details

#initialize(output_file) ⇒ FilePrinter

Returns a new instance of FilePrinter.



5
6
7
8
# File 'lib/gmail_extractor/printer/file_printer.rb', line 5

def initialize(output_file)
  @output_file = File.open(output_file,"w:utf-8")
  @output_file.sync = true
end

Instance Method Details

#<<(string) ⇒ Object



10
11
12
# File 'lib/gmail_extractor/printer/file_printer.rb', line 10

def << (string)
  @output_file << string
end

#closeObject



14
15
16
# File 'lib/gmail_extractor/printer/file_printer.rb', line 14

def close
  @output_file.close
end