Module: Faker::Game::Character
- Defined in:
- lib/faker/game/character.rb
Constant Summary collapse
- NEUTRAL_PREFIXES =
%w(byr dy mi beo tyr)
- NEUTRAL_POSTFIXES =
%w(dren bor dun mar del lad ar gren grad gard born bar bel wren rend mel dar den ful ren)
- NEUTRAL_ANIMALS =
%w(wolf dragon bear beast)
- NEUTRAL_NATURE =
%w(cliff storm wind sand earth)
- NEUTRAL_NOUNS =
CharacterTitle::NEUTRAL_PROFESSIONS + NEUTRAL_NATURE + NEUTRAL_ANIMALS
Class Method Summary collapse
- .first_name ⇒ Object
- .name ⇒ Object
- .name_with_title ⇒ Object
- .object ⇒ Object
- .prefix ⇒ Object
- .surname ⇒ Object
Class Method Details
.first_name ⇒ Object
11 12 13 |
# File 'lib/faker/game/character.rb', line 11 def first_name (NEUTRAL_PREFIXES.sample + NEUTRAL_POSTFIXES.sample) end |
.name ⇒ Object
15 16 17 |
# File 'lib/faker/game/character.rb', line 15 def name "#{first_name} #{surname}".titleize end |
.name_with_title ⇒ Object
31 32 33 |
# File 'lib/faker/game/character.rb', line 31 def name_with_title "#{name}#{separator}#{CharacterTitle.send %w(evil neutral good).sample}" end |
.object ⇒ Object
19 20 21 |
# File 'lib/faker/game/character.rb', line 19 def object NEUTRAL_NOUNS.sample + (NEUTRAL_NOUNS + [nil]).sample.to_s end |
.prefix ⇒ Object
23 24 25 |
# File 'lib/faker/game/character.rb', line 23 def prefix (NEUTRAL_PREFIXES + [nil]).sample.to_s end |
.surname ⇒ Object
27 28 29 |
# File 'lib/faker/game/character.rb', line 27 def surname (prefix + object + NEUTRAL_POSTFIXES.sample) end |