Class: Neetob::CLI::Users::Audit

Inherits:
Base
  • Object
show all
Defined in:
lib/neetob/cli/users/audit.rb

Constant Summary

Constants inherited from Base

Base::NEETO_APPS_LIST_LINK

Instance Attribute Summary collapse

Attributes inherited from Base

#ui

Instance Method Summary collapse

Methods included from Utils

#camel_case_to_slug, #is_upper?, #symbolize_keys

Constructor Details

#initialize(sandbox = false) ⇒ Audit

Returns a new instance of Audit.



11
12
13
14
# File 'lib/neetob/cli/users/audit.rb', line 11

def initialize(sandbox = false)
  super()
  @sandbox = sandbox
end

Instance Attribute Details

#sandboxObject

Returns the value of attribute sandbox.



9
10
11
# File 'lib/neetob/cli/users/audit.rb', line 9

def sandbox
  @sandbox
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/neetob/cli/users/audit.rb', line 16

def run
  users_data = users_for_all_available_apps
  users = extract_values_from_user_data(users_data)
  email_repos_map = create_email_repos_map(users)
  unique_users = users.uniq { |user| [user[0], user[1]] }.sort
  ui.info("\nUsers with multiple emails:")
  find_users_with_multiple_emails(unique_users.transpose, email_repos_map)
  ui.info("Users with emails having 3rd party domains:")
  find_users_with_invalid_emails(unique_users.transpose, email_repos_map)
end