Class: FetchEmails

Inherits:
Object
  • Object
show all
Defined in:
lib/renuo/cli/app/fetch_emails.rb

Instance Method Summary collapse

Constructor Details

#initializeFetchEmails

Returns a new instance of FetchEmails.



7
8
9
# File 'lib/renuo/cli/app/fetch_emails.rb', line 7

def initialize
  @email_list_url = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSqPiedBeGk0N75cxZApEohj5LrIWlHWUxTjfhkmK9aOsUltcqCn24sD1haIasUjVfd8UT8VdUKUc4h/pub?gid=703649940&single=true&output=csv"
end

Instance Method Details

#fetch_emailsObject



11
12
13
14
15
# File 'lib/renuo/cli/app/fetch_emails.rb', line 11

def fetch_emails
  response = get_emails(@email_list_url)
  response = handle_redirection(response) if response.is_a?(Net::HTTPRedirection)
  format_response(response)
end

#run(_args) ⇒ Object



17
18
19
20
# File 'lib/renuo/cli/app/fetch_emails.rb', line 17

def run(_args)
  say "# Here is a complete list of Renuo email addresses".colorize :green
  say fetch_emails.join("\n")
end