Class: FetchEmails
- Inherits:
-
Object
- Object
- FetchEmails
- Defined in:
- lib/renuo/cli/app/fetch_emails.rb
Instance Method Summary collapse
- #fetch_emails ⇒ Object
-
#initialize ⇒ FetchEmails
constructor
A new instance of FetchEmails.
- #run(_args) ⇒ Object
Constructor Details
#initialize ⇒ FetchEmails
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_emails ⇒ Object
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 |