Class: Faker::Games::DnD

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/games/dnd.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, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.alignmentString

Produces the name of an alignment from Dungeons and Dragons.

Examples:

Faker::Games::DnD.alignment #=> "Lawful Neutral"

Returns:

  • (String)

Available since:

  • 2.13.0


16
17
18
# File 'lib/faker/games/dnd.rb', line 16

def alignment
  fetch('dnd.alignments')
end

.backgroundString

Produces the name of a background from Dungeons and Dragons (PHB).

Examples:

Faker::Games::DnD.background #=> "Urchin"

Returns:

  • (String)

Available since:

  • 2.13.0


29
30
31
# File 'lib/faker/games/dnd.rb', line 29

def background
  fetch('dnd.backgrounds')
end

.cityString

Produces the name of a city from Dungeons and Dragons.

Examples:

Faker::Games::DnD.city #=> "Earthfast"

Returns:

  • (String)

Available since:

  • next


42
43
44
# File 'lib/faker/games/dnd.rb', line 42

def city
  fetch('dnd.cities')
end

.klassString

Produces the name of a class from Dungeons and Dragons (PHB).

Examples:

Faker::Games::DnD.klass #=> "Warlock"

Returns:

  • (String)

Available since:

  • 2.13.0


55
56
57
# File 'lib/faker/games/dnd.rb', line 55

def klass
  fetch('dnd.klasses')
end

.languageString

Produces the name of a language from Dungeons and Dragons.

Examples:

Faker::Games::DnD.language #=> "Gnomish"

Returns:

  • (String)

Available since:

  • next


68
69
70
# File 'lib/faker/games/dnd.rb', line 68

def language
  fetch('dnd.languages')
end

.melee_weaponString

Produces the name of a melee weapon from Dungeons and Dragons.

Examples:

Faker::Games::DnD.melee_weapon #=> "Handaxe"

Returns:

  • (String)

Available since:

  • next


81
82
83
# File 'lib/faker/games/dnd.rb', line 81

def melee_weapon
  fetch('dnd.melee_weapons')
end

.monsterString

Produces the name of a monster from Dungeons and Dragons.

Examples:

Faker::Games::DnD.monster #=> "Manticore"

Returns:

  • (String)

Available since:

  • next


94
95
96
# File 'lib/faker/games/dnd.rb', line 94

def monster
  fetch('dnd.monsters')
end

.raceString

Produces the name of a race from Dungeons and Dragons (PHB).

Examples:

Faker::Games::DnD.races #=> "Dwarf"

Returns:

  • (String)

Available since:

  • next


107
108
109
# File 'lib/faker/games/dnd.rb', line 107

def race
  fetch('dnd.races')
end

.ranged_weaponString

Produces the name of a ranged weapon from Dungeons and Dragons.

Examples:

Faker::Games::DnD.ranged_weapon #=> "Shortbow"

Returns:

  • (String)

Available since:

  • next


120
121
122
# File 'lib/faker/games/dnd.rb', line 120

def ranged_weapon
  fetch('dnd.ranged_weapons')
end

.speciesObject

Deprecated.

Use #race instead.

This method is deprecated. The implementation will be removed in a near future release. Use `DnD.race` instead.


128
129
130
131
132
# File 'lib/faker/games/dnd.rb', line 128

def species
  warn '`DnD.species` is deprecated. Use `DnD.race` instead.'

  super
end