Module: Grammar::Pronoun
- Defined in:
- lib/gamefic-standard/grammar/pronoun.rb
Overview
Functions to select pronouns based on an entity’s attributes, such as gender.
Class 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_)
Class Method Details
.map(entity) ⇒ Hash
73 74 75 76 77 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 73 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
29 30 31 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 29 def objective(entity) map(entity)[:objective] end |
.objective_(entity) ⇒ String Also known as: them_
36 37 38 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 36 def objective_(entity) objective(entity).cap_first end |
.possessive(entity) ⇒ String Also known as: their
43 44 45 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 43 def possessive(entity) map(entity)[:possessive] end |
.possessive_(entity) ⇒ String Also known as: their_
50 51 52 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 50 def possessive_(entity) possessive(entity).cap_first end |
.reflexive(entity) ⇒ String Also known as: themselves, themself
57 58 59 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 57 def reflexive(entity) map(entity)[:reflexive] end |
.reflexive_(entity) ⇒ String Also known as: themselves_, themself_
65 66 67 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 65 def reflexive_(entity) reflexive(entity).cap_first end |
.subjective(entity) ⇒ String Also known as: they, he, she
11 12 13 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 11 def subjective(entity) map(entity)[:subjective] end |
.subjective_(entity) ⇒ String Also known as: they_, he_, she_
20 21 22 |
# File 'lib/gamefic-standard/grammar/pronoun.rb', line 20 def subjective_(entity) subjective(entity).cap_first end |