Module: Demode::Generator

Defined in:
lib/demode/generator/person.rb,
lib/demode/generator/company.rb

Class Method Summary collapse

Class Method Details

.company_domain(id) ⇒ Object



11
12
13
14
# File 'lib/demode/generator/company.rb', line 11

def company_domain(id)
  domain_suffix = Fields.get(id,:domain_suffixes)
  [company_name(id).downcase, domain_suffix].join('.')
end

.company_name(id) ⇒ Object



5
6
7
8
9
# File 'lib/demode/generator/company.rb', line 5

def company_name(id)
  first_name = Fields.get(id,:company_names)
  last_name = Fields.get(id,:company_suffixes)
  [first_name, last_name].join(' ')
end

.email(id) ⇒ Object



11
12
13
14
15
# File 'lib/demode/generator/person.rb', line 11

def email(id)
  prefix = username(id)
  suffix = Fields.get(id,:free_emails)
  [prefix, suffix].join('@')
end

.name(id) ⇒ Object



5
6
7
8
9
# File 'lib/demode/generator/person.rb', line 5

def name(id)
  first_name = Fields.get(id,:first_names)
  last_name  = Fields.get(id,:last_names)
  [first_name, last_name].join(' ')
end

.username(id) ⇒ Object



17
18
19
20
21
22
# File 'lib/demode/generator/person.rb', line 17

def username(id)
  format = Fields.get(id,:username_formats)
  first_name = Fields.get(id,:first_names)
  last_name  = Fields.get(id,:last_names)
  format.call(first_name,last_name)
end