Module: Demode::Generator
- Defined in:
- lib/demode/generator/person.rb,
lib/demode/generator/company.rb
Class Method Summary collapse
- .company_domain(id) ⇒ Object
- .company_name(id) ⇒ Object
- .email(id) ⇒ Object
- .name(id) ⇒ Object
- .username(id) ⇒ Object
Class Method Details
.company_domain(id) ⇒ Object
9 10 11 12 |
# File 'lib/demode/generator/company.rb', line 9 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 |
# File 'lib/demode/generator/company.rb', line 5 def company_name(id) Fields.get(id,:company_names) 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 |