I'm trying to write a loop that would return 25 unique first names from the Faker gem in ruby, with the condition that each name is >= 5 characters.
I've managed to create the loop that returns the 25 unique names, but have been unable to correctly produce name.length condition. I've tried the following attempts:
Attempt 1:
names = [Faker::Name.unique.first_name]
names.each do |name|
puts name if first_name.length >= 5
25.times do
puts "#{Faker::Name.unique.first_name}"
end
end
Attempt 2:
names = [Faker::Name.unique.first_name]
25.times do
puts "#{Faker::Name.unique.first_name}"
names.each do |name|
puts name if name.length >= 5
end
end
What am I doing incorrectly?