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 two generators to Faker::Science #2175

Merged
merged 5 commits into from Apr 16, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions doc/default/science.md
Expand Up @@ -5,5 +5,9 @@ Faker::Science.element #=> "Carbon"

Faker::Science.element_symbol #=> "Pb"

Faker::Science.element_state #=> "Liquid"

Faker::Science.element_subcategory #=> "Reactive nonmetal"

Faker::Science.scientist #=> "Isaac Newton"
```
26 changes: 26 additions & 0 deletions lib/faker/default/science.rb
Expand Up @@ -29,6 +29,32 @@ def element_symbol
fetch('science.element_symbol')
end

##
# Produces the state of an element.
#
# @return [String]
#
# @example
# Faker::Science.element_state #=> "Liquid"
#
# @faker.version next
def element_state
fetch('science.element_state')
end

##
# Produces the subcategory of an element.
#
# @return [String]
#
# @example
# Faker::Science.element_subcategory #=> "Reactive nonmetal"
#
# @faker.version next
def element_subcategory
fetch('science.element_subcategory')
end

##
# Produces the name of a scientist.
#
Expand Down