Module: Grammar::Pronoun
Overview
Functions to select pronouns based on an entity’s attributes, such as gender.
Instance Method Summary collapse
- #map(entity) ⇒ Hash
- #objective(entity) ⇒ String (also: #them)
- #objective_(entity) ⇒ String (also: #them_)
- #possessive(entity) ⇒ String (also: #their)
- #possessive_(entity) ⇒ String (also: #their_)
- #reflexive(entity) ⇒ String (also: #themselves, #themself)
- #reflexive_(entity) ⇒ String (also: #themselves_, #themself_)
- #subjective(entity) ⇒ String (also: #they, #he, #she)
- #subjective_(entity) ⇒ String (also: #they_, #he_, #she_)
Instance Method Details
#map(entity) ⇒ Hash
74 75 76 77 78 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 74 def map(entity) plurality = (entity.plural? ? :plural : :singular) maps[[(entity.person || 3), plurality, entity.gender]] || maps[[(entity.person || 3), plurality]] end |
#objective(entity) ⇒ String Also known as: them
30 31 32 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 30 def objective(entity) map(entity)[:objective] end |
#objective_(entity) ⇒ String Also known as: them_
37 38 39 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 37 def objective_(entity) objective(entity).cap_first end |
#possessive(entity) ⇒ String Also known as: their
44 45 46 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 44 def possessive(entity) map(entity)[:possessive] end |
#possessive_(entity) ⇒ String Also known as: their_
51 52 53 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 51 def possessive_(entity) possessive(entity).cap_first end |
#reflexive(entity) ⇒ String Also known as: themselves, themself
58 59 60 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 58 def reflexive(entity) map(entity)[:reflexive] end |
#reflexive_(entity) ⇒ String Also known as: themselves_, themself_
66 67 68 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 66 def reflexive_(entity) reflexive(entity).cap_first end |
#subjective(entity) ⇒ String Also known as: they, he, she
12 13 14 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 12 def subjective(entity) map(entity)[:subjective] end |
#subjective_(entity) ⇒ String Also known as: they_, he_, she_
21 22 23 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 21 def subjective_(entity) subjective(entity).cap_first end |