Module: FFaker::Company

Extended by:
Company, ModuleUtils
Included in:
Company
Defined in:
lib/ffaker/company.rb

Constant Summary collapse

SUFFIXES =
%w[Inc and\ Sons LLC Group].freeze
POSITION_PREFIXES =
%w[Executive Assistant General Associate].freeze
POSITIONS =
%w[President Manager Director Secretary Consultant].freeze

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#bsObject

When a straight answer won't do, BS to the rescue! Wordlist from dack.com/web/bullshit.html


32
33
34
# File 'lib/ffaker/company.rb', line 32

def bs
  "#{fetch_sample(BS_PRE)} #{fetch_sample(BS_MID)} #{fetch_sample(BS_POS)}"
end

#catch_phraseObject

Generate a buzzword-laden catch phrase. Wordlist from www.1728.com/buzzword.htm


26
27
28
# File 'lib/ffaker/company.rb', line 26

def catch_phrase
  "#{fetch_sample(CATCH_PRE)} #{fetch_sample(CATCH_MID)} #{fetch_sample(CATCH_POS)}"
end

#nameObject


12
13
14
15
16
17
18
# File 'lib/ffaker/company.rb', line 12

def name
  case rand(0..2)
  when 0 then "#{Name.last_name} #{suffix}"
  when 1 then "#{Name.last_name}-#{Name.last_name}"
  when 2 then format('%s, %s and %s', Name.last_name, Name.last_name, Name.last_name)
  end
end

#positionObject


36
37
38
39
40
41
42
43
44
45
# File 'lib/ffaker/company.rb', line 36

def position
  case rand(0..2)
  when 0 then
    [fetch_sample(POSITION_PREFIXES), fetch_sample(POSITIONS)]
  when 1 then
    [fetch_sample(POSITION_AREAS), fetch_sample(POSITIONS)]
  when 2 then
    [fetch_sample(POSITION_PREFIXES), fetch_sample(POSITION_AREAS), fetch_sample(POSITIONS)]
  end.join(' ')
end

#suffixObject


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

def suffix
  fetch_sample(SUFFIXES)
end