Class: GmailExtractor::ConsolePrinter

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

Instance Method Summary collapse

Constructor Details

#initialize(printer = nil) ⇒ ConsolePrinter

Returns a new instance of ConsolePrinter.



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

def initialize(printer = nil)
  @printer = printer
end

Instance Method Details

#<<(string) ⇒ Object



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

def << (string)
  puts string
  @printer << string if printer?
end

#closeObject



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

def close
  @printer.close if printer?
end