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

Introduce a unified Tolkien Legendarium #2152

Merged
merged 13 commits into from
Oct 10, 2020
67 changes: 67 additions & 0 deletions lib/faker/fantasy/tolkien.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# frozen_string_literal: true

module Faker
class Fantasy
class Tolkien < Base
flexible :tolkien

class << self
##
# Produces a character from Tolkien's legendarium
#
# @return [String]
#
# @example
# Faker::Fantasy::Tolkien.character
# #=> "Goldberry"
#
# @faker.version next
def character
fetch('tolkien.characters')
end

##
# Produces a location from Tolkien's legendarium
#
# @return [String]
#
# @example
# Faker::Fantasy::Tolkien.location
# #=> "Helm's Deep"
#
# @faker.version next
def location
fetch('tolkien.locations')
end

##
# Produces a race from Tolkien's legendarium
#
# @return [String]
#
# @example
# Faker::Fantasy::Tolkien.race
# #=> "Uruk-hai"
#
# @faker.version next
def race
fetch('tolkien.races')
end

##
# Produces the name of a poem from Tolkien's legendarium
#
# @return [String]
#
# @example
# Faker::Fantasy::Tolkien.poem
# #=> "Chip the glasses and crack the plates"
#
# @faker.version next
def poem
fetch('tolkien.poems')
end
end
end
end
end
8 changes: 4 additions & 4 deletions lib/faker/movies/hobbit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class << self
#
# @faker.version 1.8.0
def character
fetch('hobbit.character')
fetch('tolkien.hobbit.character')
end

##
Expand All @@ -27,7 +27,7 @@ def character
#
# @faker.version 1.8.0
def thorins_company
fetch('hobbit.thorins_company')
fetch('tolkien.hobbit.thorins_company')
end

##
Expand All @@ -41,7 +41,7 @@ def thorins_company
#
# @faker.version 1.8.0
def quote
fetch('hobbit.quote')
fetch('tolkien.hobbit.quote')
end

##
Expand All @@ -54,7 +54,7 @@ def quote
#
# @faker.version 1.8.0
def location
fetch('hobbit.location')
fetch('tolkien.hobbit.location')
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/faker/movies/lord_of_the_rings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class << self
#
# @faker.version 1.7.0
def character
fetch('lord_of_the_rings.characters')
fetch('tolkien.lord_of_the_rings.characters')
end

##
Expand All @@ -27,7 +27,7 @@ def character
#
# @faker.version 1.7.0
def location
fetch('lord_of_the_rings.locations')
fetch('tolkien.lord_of_the_rings.locations')
end

##
Expand All @@ -41,7 +41,7 @@ def location
#
# @faker.version 1.9.0
def quote
fetch('lord_of_the_rings.quotes')
fetch('tolkien.lord_of_the_rings.quotes')
end
end
end
Expand Down
19 changes: 0 additions & 19 deletions lib/locales/en/hobbit.yml

This file was deleted.

6 changes: 0 additions & 6 deletions lib/locales/en/lord_of_the_rings.yml

This file was deleted.

Loading