class Faker::Hipster
def words(legacy_number = NOT_GIVEN, legacy_supplemental = NOT_GIVEN, legacy_spaces_allowed = NOT_GIVEN, number: 3, supplemental: false, spaces_allowed: false)
def words(legacy_number = NOT_GIVEN, legacy_supplemental = NOT_GIVEN, legacy_spaces_allowed = NOT_GIVEN, number: 3, supplemental: false, spaces_allowed: false) # rubocop:enable Metrics/ParameterLists warn_for_deprecated_arguments do |keywords| keywords << :number if legacy_number != NOT_GIVEN keywords << :supplemental if legacy_supplemental != NOT_GIVEN keywords << :spaces_allowed if legacy_spaces_allowed != NOT_GIVEN end resolved_num = resolve(number) word_list = ( translate('faker.hipster.words') + (supplemental ? translate('faker.lorem.words') : []) ) word_list *= ((resolved_num / word_list.length) + 1) return shuffle(word_list)[0, resolved_num] if spaces_allowed words = shuffle(word_list)[0, resolved_num] words.each_with_index { |w, i| words[i] = word if w =~ /\s/ } end