Class: Faker::Fantasy::Tolkien

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/fantasy/tolkien.rb

Constant Summary

Constants inherited from Base

Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, generate, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, shuffle!, translate, unique, with_locale

Class Method Details

.characterString

Produces a character from Tolkien’s legendarium

Examples:

Faker::Fantasy::Tolkien.character
 #=> "Goldberry"

Returns:



19
20
21
# File 'lib/faker/fantasy/tolkien.rb', line 19

def character
  fetch('tolkien.characters')
end

.locationString

Produces a location from Tolkien’s legendarium

Examples:

Faker::Fantasy::Tolkien.location
 #=> "Helm's Deep"

Returns:



33
34
35
# File 'lib/faker/fantasy/tolkien.rb', line 33

def location
  fetch('tolkien.locations')
end

.poemString

Produces the name of a poem from Tolkien’s legendarium

Examples:

Faker::Fantasy::Tolkien.poem
  #=> "Chip the glasses and crack the plates"

Returns:



61
62
63
# File 'lib/faker/fantasy/tolkien.rb', line 61

def poem
  fetch('tolkien.poems')
end

.raceString

Produces a race from Tolkien’s legendarium

Examples:

Faker::Fantasy::Tolkien.race
  #=> "Uruk-hai"

Returns:



47
48
49
# File 'lib/faker/fantasy/tolkien.rb', line 47

def race
  fetch('tolkien.races')
end