Class: GmailExtractor::EmailExtractor

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

Overview

Controls the extraction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, password, name, printer) ⇒ EmailExtractor

Returns a new instance of EmailExtractor.



10
11
12
13
14
15
# File 'lib/gmail_extractor/email_extractor.rb', line 10

def initialize(user, password, name, printer)
  @user = user
  @password = password
  @printer = printer
  @name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/gmail_extractor/email_extractor.rb', line 8

def name
  @name
end

#passwordObject

Returns the value of attribute password.



8
9
10
# File 'lib/gmail_extractor/email_extractor.rb', line 8

def password
  @password
end

#printerObject

Returns the value of attribute printer.



8
9
10
# File 'lib/gmail_extractor/email_extractor.rb', line 8

def printer
  @printer
end

#userObject

Returns the value of attribute user.



8
9
10
# File 'lib/gmail_extractor/email_extractor.rb', line 8

def user
  @user
end

Instance Method Details

#extract(label, limit) ⇒ Object



17
18
19
20
21
# File 'lib/gmail_extractor/email_extractor.rb', line 17

def extract(label, limit)
  connect
  extract_mails_for label, limit
  disconnect
end