Method: Faker::Lorem.word

Defined in:
lib/faker/default/lorem.rb

.word(exclude_words: nil) ⇒ String

Returs the random word

Examples:

Faker::Lorem.word   #=> "soluto"
Faker::Lorem.word(exclude_words: 'error') #=> "nisi"
Faker::Lorem.word(exclude_words: 'id, error') #=> "et"
Faker::Lorem.word(exclude_words: ['id', 'error']) #=> "consequatur"

Returns:

  • (String)

Available since:

  • 2.1.3



18
19
20
# File 'lib/faker/default/lorem.rb', line 18

def word(exclude_words: nil)
  words(number: 1, exclude_words: exclude_words).first
end