Class: Randamu::Account

Inherits:
Base
  • Object
show all
Extended by:
NameGenerator
Defined in:
lib/randamu/core/account.rb

Constant Summary collapse

ALPHABET =
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
NUMERIC =
'0123456789'
SPEACIAL =
'!@#$%&*()_+'

Constants included from NameGenerator

NameGenerator::GENDER

Class Method Summary collapse

Methods included from NameGenerator

custom_name, first_name, full_name, last_name

Methods inherited from Base

load_data

Class Method Details

.emailObject



18
19
20
# File 'lib/randamu/core/account.rb', line 18

def email
  "#{normalize(first_name.downcase)}#{generate_connection_symbol}#{normalize(last_name.downcase)}@#{load_data('emails.domains').sample}"
end

.password(length: 8, special: true, numeric: true, alphabet: true) ⇒ Object



14
15
16
# File 'lib/randamu/core/account.rb', line 14

def password(length: 8, special: true, numeric: true, alphabet: true)
  generate_password(length, special, numeric, alphabet)
end

.phone(state: Dictionary::STATES.keys.sample, country_code: false) ⇒ Object



22
23
24
25
# File 'lib/randamu/core/account.rb', line 22

def phone(state: Dictionary::STATES.keys.sample, country_code: false)
  return "+55 (#{load_data("phone.ddd.#{state}").sample}) " + phone_number if country_code
  "(#{load_data("phone.ddd.#{state}").sample}) " + phone_number
end

.phone_only_numbers(state: Dictionary::STATES.keys.sample, country_code: false) ⇒ Object



27
28
29
30
# File 'lib/randamu/core/account.rb', line 27

def phone_only_numbers(state: Dictionary::STATES.keys.sample, country_code: false)
  return "55#{load_data("phone.ddd.#{state}").sample}" + phone_number if country_code
  "#{load_data("phone.ddd.#{state}").sample}" + phone_number
end

.username(type: :default) ⇒ Object



10
11
12
# File 'lib/randamu/core/account.rb', line 10

def username(type: :default)
  load_data("names.usernames.#{type}").sample
end