Class: GmailExtractor::EmailProgressbar
- Inherits:
-
Object
- Object
- GmailExtractor::EmailProgressbar
- Defined in:
- lib/gmail_extractor/email_progressbar.rb
Overview
Simple printer proxy to enable tracking the progress with a progress bar transparently.
Instance Attribute Summary collapse
-
#printer ⇒ Object
Returns the value of attribute printer.
Instance Method Summary collapse
- #email(email) ⇒ Object
- #footer ⇒ Object
- #header ⇒ Object
-
#initialize(printer) ⇒ EmailProgressbar
constructor
A new instance of EmailProgressbar.
- #label(label, limit) ⇒ Object
Constructor Details
#initialize(printer) ⇒ EmailProgressbar
Returns a new instance of EmailProgressbar.
10 11 12 |
# File 'lib/gmail_extractor/email_progressbar.rb', line 10 def initialize(printer) @printer = printer end |
Instance Attribute Details
#printer ⇒ Object
Returns the value of attribute printer.
8 9 10 |
# File 'lib/gmail_extractor/email_progressbar.rb', line 8 def printer @printer end |
Instance Method Details
#email(email) ⇒ Object
23 24 25 26 |
# File 'lib/gmail_extractor/email_progressbar.rb', line 23 def email(email) printer.email(email) @progress_bar.inc end |
#footer ⇒ Object
18 19 20 21 |
# File 'lib/gmail_extractor/email_progressbar.rb', line 18 def printer. @progress_bar.finish end |
#header ⇒ Object
14 15 16 |
# File 'lib/gmail_extractor/email_progressbar.rb', line 14 def header printer.header end |
#label(label, limit) ⇒ Object
28 29 30 31 32 |
# File 'lib/gmail_extractor/email_progressbar.rb', line 28 def label(label,limit) printer.label(label,limit) total_count = limit || label.count @progress_bar = ProgressBar.new("emails",total_count) end |