module Faker::Game::CharacterTitle
Constants
- EVIL_ADJECTIVES
- EVIL_BODY_PARTS
- EVIL_BODY_PARTS_SINGULAR
- EVIL_NOUNS
- EVIL_VIOLENT_VERBS_AS_NOUNS
- GOOD_ANTI_VERBS_AS_NOUNS
- GOOD_NOUNS
- GOOD_VERBS_AS_NOUNS
- NEUTRAL_ADJECTIVES
- NEUTRAL_PROFESSIONS
Public Class Methods
evil()
click to toggle source
# File lib/faker/game/character_title.rb, line 16 def evil send %w(evil_base evil_proper evil_with_qualifier).sample end
evil_proper()
click to toggle source
# File lib/faker/game/character_title.rb, line 28 def evil_proper "the #{evil_base}".titleize end
good()
click to toggle source
# File lib/faker/game/character_title.rb, line 24 def good send %w(good_base good_proper good_with_qualifier).sample end
neutral()
click to toggle source
# File lib/faker/game/character_title.rb, line 20 def neutral send %w(neutral_base neutral_proper neutral_with_adjective).sample end
Private Class Methods
evil_base()
click to toggle source
# File lib/faker/game/character_title.rb, line 34 def evil_base "#{(EVIL_ADJECTIVES + [nil]).sample} #{evil_descriptor}".titleize end
evil_descriptor()
click to toggle source
# File lib/faker/game/character_title.rb, line 46 def evil_descriptor body_part = (EVIL_BODY_PARTS_SINGULAR + EVIL_BODY_PARTS).sample singular = EVIL_BODY_PARTS_SINGULAR.include? body_part !singular && rand(2) == 1 ? "#{EVIL_VIOLENT_VERBS_AS_NOUNS.sample} of #{body_part.pluralize}" : "#{body_part}#{word_separator}#{EVIL_VIOLENT_VERBS_AS_NOUNS.sample}" end
evil_qualifier()
click to toggle source
# File lib/faker/game/character_title.rb, line 42 def evil_qualifier "#{['the ', nil].sample}#{EVIL_NOUNS.sample} of #{Place.name}" end
evil_with_qualifier()
click to toggle source
# File lib/faker/game/character_title.rb, line 38 def evil_with_qualifier "#{send %w(evil_base evil_proper).sample}, #{evil_qualifier}".titleize end
good_base()
click to toggle source
# File lib/faker/game/character_title.rb, line 79 def good_base "#{GOOD_NOUNS.sample}#{['-', nil].sample}#{GOOD_VERBS_AS_NOUNS.sample}" end
good_proper()
click to toggle source
# File lib/faker/game/character_title.rb, line 71 def good_proper "the #{good_base}".titleize end
good_qualifier()
click to toggle source
# File lib/faker/game/character_title.rb, line 75 def good_qualifier "#{['the ', nil].sample}#{GOOD_ANTI_VERBS_AS_NOUNS.sample} of #{EVIL_NOUNS.sample.pluralize}" end
good_with_qualifier()
click to toggle source
# File lib/faker/game/character_title.rb, line 67 def good_with_qualifier "#{good_base} #{good_qualifier}".titleize end
neutral_base()
click to toggle source
# File lib/faker/game/character_title.rb, line 55 def neutral_base "#{NEUTRAL_PROFESSIONS.sample} of #{Place.name}" end
neutral_proper()
click to toggle source
# File lib/faker/game/character_title.rb, line 59 def neutral_proper "the #{neutral_base}".titleize end
neutral_with_adjective()
click to toggle source
# File lib/faker/game/character_title.rb, line 63 def neutral_with_adjective "#{send %w(neutral_base neutral_proper).sample} #{NEUTRAL_ADJECTIVES.sample}".titleize end
word_separator()
click to toggle source
# File lib/faker/game/character_title.rb, line 83 def word_separator ['', '-', ' '].sample end