diff --git a/lib/faker/default/nation.rb b/lib/faker/default/nation.rb index f759f2ef59..2114269889 100644 --- a/lib/faker/default/nation.rb +++ b/lib/faker/default/nation.rb @@ -4,27 +4,70 @@ module Faker class Nation < Base flexible :nation class << self - # Fetch random nationality + ## + # Produces a random nationality. + # + # @return [String] + # + # @example + # Faker::Nation.nationality #=> "Nepalese" + # + # @faker.version 1.9.0 def nationality fetch('nation.nationality') end - # Fetch random national flag emoji + # rubocop:disable Style/AsciiComments + + ## + # Produces a random national flag emoji. + # + # @return [String] + # + # @example + # Faker::Nation.flag #=> "🇫🇮" + # + # @faker.version 1.9.0 def flag sample(translate('faker.nation.flag')).pack('C*').force_encoding('utf-8') end + # rubocop:enable Style/AsciiComments - # Fetch random language + ## + # Produces a random national language. + # + # @return [String] + # + # @example + # Faker::Nation.language #=> "Nepali" + # + # @faker.version 1.9.0 def language fetch('nation.language') end - # Fetch random capital city + ## + # Produces a random capital city. + # + # @return [String] + # + # @example + # Faker::Nation.capital_city #=> "Kathmandu" + # + # @faker.version 1.9.0 def capital_city fetch('nation.capital_city') end - # Fetch random natinal sport + ## + # Produces a random national sport. + # + # @return [String] + # + # @example + # Faker::Nation.national_sport #=> "dandi biyo" + # + # @faker.version 1.9.0 def national_sport fetch('team.sport') end diff --git a/lib/faker/japanese_media/one_piece.rb b/lib/faker/japanese_media/one_piece.rb index b0923ceb84..88b6a0ea8a 100644 --- a/lib/faker/japanese_media/one_piece.rb +++ b/lib/faker/japanese_media/one_piece.rb @@ -4,26 +4,80 @@ module Faker class JapaneseMedia class OnePiece < Base class << self + ## + # Produces a character from One Piece. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::OnePiece.character #=> "Monkey D. Luffy" + # + # @faker.version 1.8.5 def character fetch('one_piece.characters') end + ## + # Produces a sea from One Piece. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::OnePiece.sea #=> "East Blue" + # + # @faker.version 1.8.5 def sea fetch('one_piece.seas') end + ## + # Produces an island from One Piece. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::OnePiece.island #=> "Laftel" + # + # @faker.version 1.8.5 def island fetch('one_piece.islands') end + ## + # Produces a location from One Piece. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::OnePiece.location #=> "Foosha Village" + # + # @faker.version 1.8.5 def location fetch('one_piece.locations') end + ## + # Produces a quote from One Piece. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::OnePiece.quote #=> "ONE PIECE IS REAL!" + # + # @faker.version 1.8.5 def quote fetch('one_piece.quotes') end + ## + # Produces an akuma no mi from One Piece. + # + # @return [String] + # + # @example + # Faker::JapaneseMedia::OnePiece.akuma_no_mi #=> "Gomu Gomu no Mi" + # + # @faker.version 1.8.5 def akuma_no_mi fetch('one_piece.akumas_no_mi') end diff --git a/lib/faker/movies/back_to_the_future.rb b/lib/faker/movies/back_to_the_future.rb index 040feb48eb..8aad8936d2 100644 --- a/lib/faker/movies/back_to_the_future.rb +++ b/lib/faker/movies/back_to_the_future.rb @@ -4,14 +4,42 @@ module Faker class Movies class BackToTheFuture < Base class << self + ## + # Produces a character from Back to the Future. + # + # @return [String] + # + # @example + # Faker::Movies::BackToTheFuture.character #=> "Marty McFly" + # + # @faker.version 1.8.5 def character fetch('back_to_the_future.characters') end + ## + # Produces a date from Back to the Future. + # + # @return [String] + # + # @example + # Faker::Movies::BackToTheFuture.date #=> "November 5, 1955" + # + # @faker.version 1.8.5 def date fetch('back_to_the_future.dates') end + ## + # Produces a quote from Back to the Future. + # + # @return [String] + # + # @example + # Faker::Movies::BackToTheFuture.quote + # #=> "Roads? Where we're going, we don't need roads." + # + # @faker.version 1.8.5 def quote fetch('back_to_the_future.quotes') end diff --git a/lib/faker/movies/ghostbusters.rb b/lib/faker/movies/ghostbusters.rb index b1a1e4d9aa..9e5477a8dd 100644 --- a/lib/faker/movies/ghostbusters.rb +++ b/lib/faker/movies/ghostbusters.rb @@ -4,14 +4,42 @@ module Faker class Movies class Ghostbusters < Base class << self + ## + # Produces an actor from Ghostbusters. + # + # @return [String] + # + # @example + # Faker::Movies::Ghostbusters.actor #=> "Bill Murray" + # + # @faker.version 1.9.2 def actor fetch('ghostbusters.actors') end + ## + # Produces a character from Ghostbusters. + # + # @return [String] + # + # @example + # Faker::Movies::Ghostbusters.character #=> "Dr. Egon Spengler" + # + # @faker.version 1.9.2 def character fetch('ghostbusters.characters') end + ## + # Produces a quote from Ghostbusters. + # + # @return [String] + # + # @example + # Faker::Movies::Ghostbusters.quote + # #=> "I tried to think of the most harmless thing. Something I loved from my childhood. Something that could never ever possibly destroy us. Mr. Stay Puft!" + # + # @faker.version 1.9.2 def quote fetch('ghostbusters.quotes') end diff --git a/lib/faker/movies/harry_potter.rb b/lib/faker/movies/harry_potter.rb index 62d6e20830..0e2e39efd6 100644 --- a/lib/faker/movies/harry_potter.rb +++ b/lib/faker/movies/harry_potter.rb @@ -4,26 +4,80 @@ module Faker class Movies class HarryPotter < Base class << self + ## + # Produces a character from Harry Potter. + # + # @return [String] + # + # @example + # Faker::Movies::HarryPotter.character #=> "Harry Potter" + # + # @faker.version 1.7.3 def character fetch('harry_potter.characters') end + ## + # Produces a location from Harry Potter. + # + # @return [String] + # + # @example + # Faker::Movies::HarryPotter.location #=> "Hogwarts" + # + # @faker.version 1.7.3 def location fetch('harry_potter.locations') end + ## + # Produces a quote from Harry Potter. + # + # @return [String] + # + # @example + # Faker::Movies::HarryPotter.quote #=> "I solemnly swear that I am up to good." + # + # @faker.version 1.7.3 def quote fetch('harry_potter.quotes') end + ## + # Produces a book from Harry Potter. + # + # @return [String] + # + # @example + # Faker::Movies::HarryPotter.book #=> "Harry Potter and the Chamber of Secrets" + # + # @faker.version 1.7.3 def book fetch('harry_potter.books') end + ## + # Produces a house from Harry Potter. + # + # @return [String] + # + # @example + # Faker::Movies::HarryPotter.house #=> "Gryffindor" + # + # @faker.version 1.7.3 def house fetch('harry_potter.houses') end + ## + # Produces a spell from Harry Potter. + # + # @return [String] + # + # @example + # Faker::Movies::HarryPotter.spell #=> "Reparo" + # + # @faker.version 1.7.3 def spell fetch('harry_potter.spells') end diff --git a/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb b/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb index 124e8f2a5c..c5a47994a3 100644 --- a/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb +++ b/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb @@ -4,30 +4,99 @@ module Faker class Movies class HitchhikersGuideToTheGalaxy < Base class << self + ## + # Produces a character from The Hitchhiker's Guide to the Galaxy. + # + # @return [String] + # + # @example + # Faker::Movies::HitchhikersGuideToTheGalaxy.character #=> "Marvin" + # + # @faker.version 1.8.0 def character fetch('hitchhikers_guide_to_the_galaxy.characters') end + ## + # Produces a location from The Hitchhiker's Guide to the Galaxy. + # + # @return [String] + # + # @example + # Faker::Movies::HitchhikersGuideToTheGalaxy.location + # #=> "Arthur Dent's house" + # + # @faker.version 1.8.0 def location fetch('hitchhikers_guide_to_the_galaxy.locations') end + ## + # Produces a Marvin quote from The Hitchhiker's Guide to the Galaxy. + # + # @return [String] + # + # @example + # Faker::Movies::HitchhikersGuideToTheGalaxy.marvin_quote + # #=> "Life? Don't talk to me about life." + # + # @faker.version 1.8.0 def marvin_quote fetch('hitchhikers_guide_to_the_galaxy.marvin_quote') end + ## + # Produces a planet from The Hitchhiker's Guide to the Galaxy. + # + # @return [String] + # + # @example + # Faker::Movies::HitchhikersGuideToTheGalaxy.planet + # #=> "Magrathea" + # + # @faker.version 1.8.0 def planet fetch('hitchhikers_guide_to_the_galaxy.planets') end + ## + # Produces a quote from The Hitchhiker's Guide to the Galaxy. + # + # @return [String] + # + # @example + # Faker::Movies::HitchhikersGuideToTheGalaxy.quote + # #=> "In the beginning, the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." + # + # @faker.version 1.8.0 def quote fetch('hitchhikers_guide_to_the_galaxy.quotes') end + ## + # Produces a species from The Hitchhiker's Guide to the Galaxy. + # + # @return [String] + # + # @example + # Faker::Movies::HitchhikersGuideToTheGalaxy.specie + # #=> "Perfectly Normal Beast" + # + # @faker.version 1.8.0 def specie fetch('hitchhikers_guide_to_the_galaxy.species') end + ## + # Produces a starship from The Hitchhiker's Guide to the Galaxy. + # + # @return [String] + # + # @example + # Faker::Movies::HitchhikersGuideToTheGalaxy.starship + # #=> "Vogon Constructor Fleet" + # + # @faker.version 1.8.0 def starship fetch('hitchhikers_guide_to_the_galaxy.starships') end diff --git a/lib/faker/movies/lebowski.rb b/lib/faker/movies/lebowski.rb index 68b92dc4ee..7764a3145a 100644 --- a/lib/faker/movies/lebowski.rb +++ b/lib/faker/movies/lebowski.rb @@ -4,14 +4,41 @@ module Faker class Movies class Lebowski < Base class << self + ## + # Produces an actor from The Big Lebowski. + # + # @return [String] + # + # @example + # Faker::Movies::Lebowski.actor #=> "John Goodman" + # + # @faker.version 1.8.8 def actor fetch('lebowski.actors') end + ## + # Produces a character from The Big Lebowski. + # + # @return [String] + # + # @example + # Faker::Movies::Lebowski.character #=> "Jackie Treehorn" + # + # @faker.version 1.8.8 def character fetch('lebowski.characters') end + ## + # Produces a quote from The Big Lebowski. + # + # @return [String] + # + # @example + # Faker::Movies::Lebowski.quote #=> "Forget it, Donny, you're out of your element!" + # + # @faker.version 1.8.8 def quote fetch('lebowski.quotes') end diff --git a/lib/faker/movies/lord_of_the_rings.rb b/lib/faker/movies/lord_of_the_rings.rb index b737ac7001..08b6b25318 100644 --- a/lib/faker/movies/lord_of_the_rings.rb +++ b/lib/faker/movies/lord_of_the_rings.rb @@ -4,14 +4,42 @@ module Faker class Movies class LordOfTheRings < Base class << self + ## + # Produces a character from Lord of the Rings. + # + # @return [String] + # + # @example + # Faker::Movies::LordOfTheRings.character #=> "Legolas" + # + # @faker.version 1.7.0 def character fetch('lord_of_the_rings.characters') end + ## + # Produces a location from Lord of the Rings. + # + # @return [String] + # + # @example + # Faker::Movies::LordOfTheRings.location #=> "Helm's Deep" + # + # @faker.version 1.7.0 def location fetch('lord_of_the_rings.locations') end + ## + # Produces a quote from Lord of the Rings. + # + # @return [String] + # + # @example + # Faker::Movies::LordOfTheRings.quote + # #=> "I wish the Ring had never come to me. I wish none of this had happened." + # + # @faker.version 1.9.0 def quote fetch('lord_of_the_rings.quotes') end diff --git a/lib/faker/movies/princess_bride.rb b/lib/faker/movies/princess_bride.rb index 3484d108dc..cf8da0497c 100644 --- a/lib/faker/movies/princess_bride.rb +++ b/lib/faker/movies/princess_bride.rb @@ -4,10 +4,29 @@ module Faker class Movies class PrincessBride < Base class << self + ## + # Produces a character from The Princess Bride. + # + # @return [String] + # + # @example + # Faker::Movies::PrincessBride.character #=> "Dread Pirate Roberts" + # + # @faker.version 1.9.0 def character fetch('princess_bride.characters') end + ## + # Produces a quote from The Princess Bride. + # + # @return [String] + # + # @example + # Faker::Movies::PrincessBride.quote + # #=> "Hello. My name is Inigo Montoya. You killed my father. Prepare to die!" + # + # @faker.version 1.9.0 def quote fetch('princess_bride.quotes') end diff --git a/lib/faker/movies/star_wars.rb b/lib/faker/movies/star_wars.rb index ad34bf8b7e..c565b22211 100644 --- a/lib/faker/movies/star_wars.rb +++ b/lib/faker/movies/star_wars.rb @@ -4,38 +4,118 @@ module Faker class Movies class StarWars < Base class << self + ## + # Produces a call squadron from Star Wars. + # + # @return [String] + # + # @example + # Faker::Movies::StarWars.call_squadron #=> "Green" + # + # @faker.version 1.6.2 def call_squadron sample(call_squadrons) end + ## + # Produces a call sign from Star Wars. + # + # @return [String] + # + # @example + # Faker::Movies::StarWars.call_sign #=> "Grey 5" + # + # @faker.version 1.6.2 def call_sign numerify(parse('star_wars.call_sign')) end + ## + # Produces a call number from Star Wars. + # + # @return [String] + # + # @example + # Faker::Movies::StarWars.call_number #=> "Leader" + # + # @faker.version 1.6.2 def call_number sample(call_numbers) end + ## + # Produces a character from Star Wars. + # + # @return [String] + # + # @example + # Faker::Movies::StarWars.character #=> "Anakin Skywalker" + # + # @faker.version 1.6.2 def character sample(characters) end + ## + # Produces a droid from Star Wars. + # + # @return [String] + # + # @example + # Faker::Movies::StarWars.droid #=> "C-3PO" + # + # @faker.version 1.6.2 def droid sample(droids) end + ## + # Produces a planet from Star Wars. + # + # @return [String] + # + # @example + # Faker::Movies::StarWars.planet #=> "Tatooine" + # + # @faker.version 1.6.2 def planet sample(planets) end + ## + # Produces a species from Star Wars. + # + # @return [String] + # + # @example + # Faker::Movies::StarWars.specie #=> "Gungan" + # + # @faker.version 1.6.2 def specie sample(species) end + ## + # Produces a vehicle from Star Wars. + # + # @return [String] + # + # @example + # Faker::Movies::StarWars.vehicle #=> "Sandcrawler" + # + # @faker.version 1.6.2 def vehicle sample(vehicles) end + # Produces a wookiee sentence from Star Wars. + # + # @return [String] + # + # @example + # Faker::Movies::StarWars.wookiee_sentence #=> "Yrroonn ru ooma roo ahuma ur roooarrgh hnn-rowr." + # + # @faker.version 1.6.2 def wookiee_sentence sentence = sample(wookiee_words).capitalize @@ -44,6 +124,20 @@ def wookiee_sentence sentence + sample(['.', '?', '!']) end + ## + # Produces a quote from Star Wars. + # + # @param character [String] The name of a character to derive a quote from. + # @return [String] + # + # @example + # Faker::Movies::StarWars.quote #=> "Aren't you a little short for a Stormtrooper?" + # + # @example + # Faker::Movies::StarWars.quote(character: "leia_organa") + # #=> "Aren't you a little short for a Stormtrooper?" + # + # @faker.version 1.6.2 def quote(legacy_character = NOT_GIVEN, character: nil) warn_for_deprecated_arguments do |keywords| keywords << :character if legacy_character != NOT_GIVEN diff --git a/lib/faker/movies/v_for_vendetta.rb b/lib/faker/movies/v_for_vendetta.rb index 85a87ead93..ccb6d08e45 100644 --- a/lib/faker/movies/v_for_vendetta.rb +++ b/lib/faker/movies/v_for_vendetta.rb @@ -4,14 +4,43 @@ module Faker class Movies class VForVendetta < Base class << self + ## + # Produces a character from V For Vendetta. + # + # @return [String] + # + # @example + # Faker::Movies::VForVendetta.character #=> "V" + # + # @faker.version 1.8.5 def character fetch('v_for_vendetta.characters') end + ## + # Produces a speech from V For Vendetta. + # + # @return [String] + # + # @example + # Faker::Movies::VForVendetta.speech + # #=> "Remember, remember, the Fifth of November, the Gunpowder Treason and Plot. I know of no reason why the Gunpowder Treason should ever be forgot..." + # + # @faker.version 1.8.5 def speech fetch('v_for_vendetta.speeches') end + ## + # Produces a quote from V For Vendetta. + # + # @return [String] + # + # @example + # Faker::Movies::VForVendetta.quote + # #=> "People should not be afraid of their governments. Governments should be afraid of their people." + # + # @faker.version 1.8.5 def quote fetch('v_for_vendetta.quotes') end