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 to Faker::Quotes #2015

Merged
merged 6 commits into from
May 26, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion lib/faker/quotes/quote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,80 @@
module Faker
class Quote < Base
class << self
##
# Produces a famous last words quote.
#
# @return [String]
#
# @example
# Faker::Quote.famous_last_words #=> "My vocabulary did this to me. Your love will let you go on..."
#
# @faker.version 1.9.0
def famous_last_words
fetch('quote.famous_last_words')
end

##
# Produces a quote from Matz.
#
# @return [String]
#
# @example
# Faker::Quote.matz #=> "You want to enjoy life, don't you? If you get your job done quickly and your job is fun, that's good isn't it? That's the purpose of life, partly. Your life is better."
#
# @faker.version 1.9.0
def matz
fetch('quote.matz')
end

##
# Produces a quote about the most interesting man in the world.
#
# @return [String]
#
# @example
# Faker::Quote.most_interesting_man_in_the_world #=> "He can speak Russian... in French"
#
# @faker.version 1.9.0
def most_interesting_man_in_the_world
fetch('quote.most_interesting_man_in_the_world')
end

##
# Produces a Robin quote.
#
# @return [String]
#
# @example
# Faker::Quote.robin #=> "Holy Razors Edge"
#
# @faker.version 1.9.0
def robin
fetch('quote.robin')
end

##
# Produces a singular siegler quote.
#
# @return [String]
#
# @example
# Faker::Quote.singular_siegler #=> "Texas!"
#
# @faker.version 1.9.0
def singular_siegler
fetch('quote.singular_siegler')
end

# from: http://morecoolquotes.com/famous-yoda-quotes/
##
# Produces a quote from Yoda.
#
# @return [String]
#
# @example
# Faker::Quote.yoda #=> "Use your feelings, Obi-Wan, and find him you will."
#
# @faker.version 1.9.0
def yoda
fetch('quote.yoda')
end
Expand Down
36 changes: 36 additions & 0 deletions lib/faker/quotes/shakespeare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,54 @@ module Faker
class Quotes
class Shakespeare < Base
class << self
##
# Produces a Shakespeare quote from Hamlet.
#
# @return [String]
#
# @example
# Faker::Quotes::Shakespeare.hamlet_quote # => "To be, or not to be: that is the question."
#
# @faker.version 1.9.2
def hamlet_quote
sample(hamlet)
end

##
# Produces a Shakespeare quote from As You Like It.
#
# @return [String]
#
# @example
# Faker::Quotes::Shakespeare.as_you_like_it_quote # => "Can one desire too much of a good thing?."
#
# @faker.version 1.9.2
def as_you_like_it_quote
sample(as_you_like_it)
end

##
# Produces a Shakespeare quote from King Richard III.
#
# @return [String]
#
# @example
# Faker::Quotes::Shakespeare.king_richard_iii_quote # => "Now is the winter of our discontent."
#
# @faker.version 1.9.2
def king_richard_iii_quote
sample(king_richard_iii)
end

##
# Produces a Shakespeare quote from Romeo And Juliet.
#
# @return [String]
#
# @example
# Faker::Quotes::Shakespeare.romeo_and_juliet_quote # => "O Romeo, Romeo! wherefore art thou Romeo?."
#
# @faker.version 1.9.2
def romeo_and_juliet_quote
sample(romeo_and_juliet)
end
Expand Down