Class: Faker::Company
- Inherits:
-
Base
- Object
- Base
- Faker::Company
show all
- Defined in:
- lib/faker/company.rb
Constant Summary
Constants inherited
from Base
Base::Letters, Base::Numbers, Base::ULetters
Class Method Summary
collapse
Methods inherited from Base
bothify, fetch, flexible, letterify, method_missing, numerify, parse, rand_in_range, regexify, translate
Class Method Details
.bs ⇒ Object
When a straight answer won’t do, BS to the rescue!
28
29
30
|
# File 'lib/faker/company.rb', line 28
def bs
translate('faker.company.bs').collect {|list| list.sample }.join(' ')
end
|
.buzzword ⇒ Object
23
24
25
|
# File 'lib/faker/company.rb', line 23
def buzzword
translate('faker.company.buzzwords').flatten.sample
end
|
.catch_phrase ⇒ Object
Generate a buzzword-laden catch phrase.
19
20
21
|
# File 'lib/faker/company.rb', line 19
def catch_phrase
translate('faker.company.buzzwords').collect {|list| list.sample }.join(' ')
end
|
.duns_number ⇒ Object
36
37
38
|
# File 'lib/faker/company.rb', line 36
def duns_number
('%09d' % rand(10 ** 9)).gsub(/(\d\d)(\d\d\d)(\d\d\d\d)/, '\\1-\\2-\\3')
end
|
.ein ⇒ Object
32
33
34
|
# File 'lib/faker/company.rb', line 32
def ein
('%09d' % rand(10 ** 9)).gsub(/(\d\d)(\d\d\d\d\d\d\d)/, '\\1-\\2')
end
|
.industry ⇒ Object
14
15
16
|
# File 'lib/faker/company.rb', line 14
def industry
fetch('company.industry')
end
|
.logo ⇒ Object
Get a random company logo url in PNG format.
41
42
43
44
|
# File 'lib/faker/company.rb', line 41
def logo
rand_num = Random.rand(13) + 1
"https://pigment.github.io/fake-logos/logos/medium/color/#{rand_num}.png"
end
|
.name ⇒ Object
6
7
8
|
# File 'lib/faker/company.rb', line 6
def name
parse('company.name')
end
|
.profession ⇒ Object
51
52
53
|
# File 'lib/faker/company.rb', line 51
def profession
fetch('company.profession')
end
|
.suffix ⇒ Object
10
11
12
|
# File 'lib/faker/company.rb', line 10
def suffix
fetch('company.suffix')
end
|
.swedish_organisation_number ⇒ Object
46
47
48
49
|
# File 'lib/faker/company.rb', line 46
def swedish_organisation_number
base = ('%09d' % rand(10 ** 9))
base + luhn_algorithm(base).to_s
end
|