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 YARD docs for Doctor Who and fix a method name. #1758

Merged
merged 6 commits into from
Sep 21, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/tv_shows/dr_who.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Faker::TvShows::DrWho.catch_phrase #=> "Fantastic!"

Faker::TvShows::DrWho.quote #=> "Lots of planets have a north!"

Faker::TvShows::DrWho.villian #=> "The Master"
Faker::TvShows::DrWho.villain #=> "The Master"

Faker::TvShows::DrWho.specie #=> "Dalek"
```
78 changes: 77 additions & 1 deletion lib/faker/tv_shows/dr_who.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,106 @@ class DrWho < Base
flexible :dr_who

class << self
##
# Produces a character from Doctor Who.
#
# @return [String]
#
# @example
# Faker::TvShows::DrWho.character #=> "Captain Jack Harkness"
#
# @faker.version 1.8.0
def character
fetch('dr_who.character')
end

##
# Produces an iteration of The Doctor from Doctor Who.
#
# @return [String]
#
# @example
# Faker::TvShows::DrWho.the_doctor #=> "Ninth Doctor"
#
# @faker.version 1.8.0
def the_doctor
fetch('dr_who.the_doctors')
end

##
# Produces an actor from Doctor Who.
#
# @return [String]
#
# @example
# Faker::TvShows::DrWho.actor #=> "Matt Smith"
#
# @faker.version 1.9.0
def actor
fetch('dr_who.actors')
end

##
# Produces a catch phrase from Doctor Who.
#
# @return [String]
#
# @example
# Faker::TvShows::DrWho.catch_phrase #=> "Fantastic!"
#
# @faker.version 1.8.0
def catch_phrase
fetch('dr_who.catch_phrases')
end

##
# Produces a quote from Doctor Who.
#
# @return [String]
#
# @example
# Faker::TvShows::DrWho.quote #=> "Lots of planets have a north!"
#
# @faker.version 1.8.0
def quote
fetch('dr_who.quotes')
end

##
# Produces a villain from Doctor Who.
#
# @return [String]
#
# @example
# Faker::TvShows::DrWho.villian #=> "The Master"
#
# @deprecated Use the correctly-spelled `villain` method instead.
#
# @faker.version 1.8.0
def villian
connorshea marked this conversation as resolved.
Show resolved Hide resolved
fetch('dr_who.villians')
fetch('dr_who.villains')
end

##
# Produces a villain from Doctor Who.
#
# @return [String]
#
# @example
# Faker::TvShows::DrWho.villain #=> "The Master"
#
# @faker.version next
alias villain villian

##
# Produces a species from Doctor Who.
#
# @return [String]
#
# @example
# Faker::TvShows::DrWho.specie #=> "Dalek"
#
# @faker.version 1.8.0
def specie
fetch('dr_who.species')
end
Expand Down
2 changes: 1 addition & 1 deletion lib/locales/en/dr_who.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ en:
"Aw, I wanted to be ginger! I've never been ginger!",
"Crossing into established events is strictly forbidden. Except for cheap tricks.",
]
villians: [
villains: [
"Helen A", "Abzorbaloff", "Animus", "The Master", "Davros", "Dalek Emperor"
]
species: [
Expand Down