Skip to content

Commit

Permalink
Add YARD docs to Faker::Quotes (#2015)
Browse files Browse the repository at this point in the history
* Add YARD docs to Faker::Quote

* Add YARD docs to Faker::Quotes::Shakespeare

* Update to correct faker version

* Add missing private statement

* Replace non-ascii dots with regular ones

* Take the private question out of the pr
  • Loading branch information
danielTiringer committed May 26, 2020
1 parent e41d758 commit acebadd
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 1 deletion.
55 changes: 54 additions & 1 deletion lib/faker/quotes/quote.rb
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
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

0 comments on commit acebadd

Please sign in to comment.