Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Faker::Emotion word generators #2324

Merged
merged 1 commit into from Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -161,6 +161,7 @@ gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'mast
- [Faker::Drone](doc/drone/drone.md)
- [Faker::Educator](doc/default/educator.md)
- [Faker::ElectricalComponents](doc/default/electrical_components.md)
- [Faker::Emotion](doc/default/emotion.md)
- [Faker::Esport](doc/default/esport.md)
- [Faker::File](doc/default/file.md)
- [Faker::Fillmurray](doc/default/fillmurray.md)
Expand Down
6 changes: 6 additions & 0 deletions doc/default/emotion.md
@@ -0,0 +1,6 @@
# Faker::Emotion

```ruby
Faker::Emotion.noun #=> "euphoria"
Faker::Emotion.adjective #=> "chagrined"
```
33 changes: 33 additions & 0 deletions lib/faker/default/emotion.rb
@@ -0,0 +1,33 @@
# frozen_string_literal: true

module Faker
class Emotion < Base
class << self
##
# Produces an emotion noun.
#
# @return [String]
#
# @example
# Faker::Emotion.noun #=> "amazement"
#
jayqui marked this conversation as resolved.
Show resolved Hide resolved
# @faker.version next
def noun
fetch('emotion.noun')
end

##
# Produces an emotion adjective.
#
# @return [String]
#
# @example
# Faker::Emotion.adjective # => "nonplussed"
#
# @faker.version next
def adjective
fetch('emotion.adjective')
end
end
end
end