Class: Faker::Company

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/company.rb

Constant Summary

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

.bsObject

When a straight answer won't do, BS to the rescue!



20
21
22
# File 'lib/faker/company.rb', line 20

def bs
  translate('faker.company.bs').collect {|list| list.sample }.join(' ')
end

.catch_phraseObject

Generate a buzzword-laden catch phrase.



15
16
17
# File 'lib/faker/company.rb', line 15

def catch_phrase
  translate('faker.company.buzzwords').collect {|list| list.sample }.join(' ')
end

.duns_numberObject



28
29
30
# File 'lib/faker/company.rb', line 28

def duns_number
  ('%09d' % rand(10 ** 9)).gsub(/(\d\d)(\d\d\d)(\d\d\d\d)/, '\\1-\\2-\\3')
end

.einObject



24
25
26
# File 'lib/faker/company.rb', line 24

def ein
  ('%09d' % rand(10 ** 9)).gsub(/(\d\d)(\d\d\d\d\d\d\d)/, '\\1-\\2')
end

.logoObject

Get a random company logo url in GIF format.



33
34
35
36
# File 'lib/faker/company.rb', line 33

def 
  rand_num = Random.rand(76) + 1
  "http://www.biz-logo.com/examples/#{ rand_num < 10 ? "00" : "0" }#{rand_num}.gif"
end

.nameObject



6
7
8
# File 'lib/faker/company.rb', line 6

def name
  parse('company.name')
end

.suffixObject



10
11
12
# File 'lib/faker/company.rb', line 10

def suffix
  fetch('company.suffix')
end