Sha256: 14baacfab67da9412947cecd8dffa0352f4997f42677708871cbb64a1db47e8f

Contents?: true

Size: 1.34 KB

Versions: 6

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

module FFakerTW
  module Company
    extend ModuleUtils
    extend self

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

    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

    def suffix
      fetch_sample(SUFFIXES)
    end

    # Generate a buzzword-laden catch phrase.
    # Wordlist from http://www.1728.com/buzzword.htm
    def catch_phrase
      "#{fetch_sample(CATCH_PRE)} #{fetch_sample(CATCH_MID)} #{fetch_sample(CATCH_POS)}"
    end

    # When a straight answer won't do, BS to the rescue!
    # Wordlist from http://dack.com/web/bullshit.html
    def bs
      "#{fetch_sample(BS_PRE)} #{fetch_sample(BS_MID)} #{fetch_sample(BS_POS)}"
    end

    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
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ffakerTW-1.8.0 lib/ffakerTW/company.rb
ffakerTW-1.7.0 lib/ffakerTW/company.rb
ffakerTW-1.6.0 lib/ffakerTW/company.rb
ffakerTW-1.5.0 lib/ffakerTW/company.rb
ffakerTW-1.4.0 lib/ffakerTW/company.rb
ffakerTW-0.1.0 lib/ffakerTW/company.rb