Skip to content
Open
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Change log itself follows [Keep a CHANGELOG](http://keepachangelog.com) format.
## Unreleased

### Added
- `Faker.Tolkien` Add tolkien legendarium [[@mathisto](https://github.com/mathisto)]
- `Faker.Tolkien.En` Add tolkien legendarium [[@mathisto](https://github.com/mathisto)]
- `Faker.Fruits.En` - add english fruits [[@KevinDaSilvaS](https://github.com/KevinDaSilvaS)]

### Changed
Expand Down
2 changes: 2 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
<!-- T -->
- [Faker.Team](lib/faker/team.ex)
- [Faker.Team.En](lib/faker/team/en.ex)
- [Faker.Tolkien](lib/faker/tolkien.ex)
- [Faker.Tolkien.En](lib/faker/tolkien/en.ex)
<!-- U -->
- [Faker.Util](lib/faker/util.ex)
- [Faker.UUID](lib/faker/uuid.ex)
Expand Down
75 changes: 75 additions & 0 deletions lib/faker/tolkien.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
defmodule Faker.Tolkien do
import Faker, only: [localize: 1]

@moduledoc """
Functions for generating J.R.R Tolkien legendarium data.
"""

@doc """
Returns a random J.R.R. Tolkien race

## Examples

iex> Faker.Tolkien.race()
"Uruk-hai"
iex> Faker.Tolkien.race()
"Trolls"
iex> Faker.Tolkien.race()
"Half-trolls"
iex> Faker.Tolkien.race()
"Vampire"
"""
@spec race() :: String.t()
localize(:race)

@doc """
Returns a random J.R.R. Tolkien poem name

## Examples

iex> Faker.Tolkien.poem()
"A Elbereth Gilthoniel"
iex> Faker.Tolkien.poem()
"The Road Goes Ever On and On"
iex> Faker.Tolkien.poem()
"Arise, arise, Riders of Theoden!"
iex> Faker.Tolkien.poem()
"A Rhyme of Lore"
"""
@spec poem() :: String.t()
localize(:poem)

@doc """
Returns a random Tolkien name

## Examples

iex> Faker.Tolkien.name()
"Tar-Amandil"
iex> Faker.Tolkien.name()
"Saradas Brandybuck"
iex> Faker.Tolkien.name()
"Reginard Took"
iex> Faker.Tolkien.name()
"Bereg"
"""
@spec name() :: String.t()
localize(:name)

@doc """
Returns a random Tolkien location

## Examples

iex> Faker.Tolkien.location()
"Bree-land"
iex> Faker.Tolkien.location()
"Buckland"
iex> Faker.Tolkien.location()
"River of Aros"
iex> Faker.Tolkien.location()
"Dimrill Gate"
"""
@spec location() :: String.t()
localize(:location)
end
Loading