Class: FactoryHelper::Company
- Defined in:
- lib/factory-helper/company.rb
Constant Summary
Constants inherited from Base
Base::Letters, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.bs ⇒ Object
When a straight answer won’t do, BS to the rescue!.
- .buzzword ⇒ Object
-
.catch_phrase ⇒ Object
Generate a buzzword-laden catch phrase.
- .duns_number ⇒ Object
- .ein ⇒ Object
-
.logo ⇒ Object
Get a random company logo url in PNG format.
- .name ⇒ Object
- .suffix ⇒ Object
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!
24 25 26 |
# File 'lib/factory-helper/company.rb', line 24 def bs translate('factory_helper.company.bs').collect {|list| list.sample(:random => FactoryHelper::Config.random) }.join(' ') end |
.buzzword ⇒ Object
19 20 21 |
# File 'lib/factory-helper/company.rb', line 19 def buzzword translate('factory_helper.company.buzzwords').flatten.sample(:random => FactoryHelper::Config.random) end |
.catch_phrase ⇒ Object
Generate a buzzword-laden catch phrase.
15 16 17 |
# File 'lib/factory-helper/company.rb', line 15 def catch_phrase translate('factory_helper.company.buzzwords').collect {|list| list.sample(:random => FactoryHelper::Config.random) }.join(' ') end |
.duns_number ⇒ Object
32 33 34 |
# File 'lib/factory-helper/company.rb', line 32 def duns_number ('%09d' % FactoryHelper::Config.random.rand(10 ** 9)).gsub(/(\d\d)(\d\d\d)(\d\d\d\d)/, '\\1-\\2-\\3') end |
.ein ⇒ Object
28 29 30 |
# File 'lib/factory-helper/company.rb', line 28 def ein ('%09d' % FactoryHelper::Config.random.rand(10 ** 9)).gsub(/(\d\d)(\d\d\d\d\d\d\d)/, '\\1-\\2') end |
.logo ⇒ Object
Get a random company logo url in PNG format.
37 38 39 40 |
# File 'lib/factory-helper/company.rb', line 37 def logo rand_num = FactoryHelper::Config.random.rand(13) + 1 "http://pigment.github.io/fake-logos/logos/medium/color/#{rand_num}.png" end |
.name ⇒ Object
6 7 8 |
# File 'lib/factory-helper/company.rb', line 6 def name parse('company.name') end |
.suffix ⇒ Object
10 11 12 |
# File 'lib/factory-helper/company.rb', line 10 def suffix fetch('company.suffix') end |