Class: Verbs::Conjugator::Conjugations
- Inherits:
-
Object
- Object
- Verbs::Conjugator::Conjugations
- Includes:
- Singleton
- Defined in:
- lib/verbs/conjugator.rb
Instance Attribute Summary collapse
-
#copulars ⇒ Object
readonly
Returns the value of attribute copulars.
-
#irregulars ⇒ Object
readonly
Returns the value of attribute irregulars.
-
#single_terminal_consonants ⇒ Object
readonly
Returns the value of attribute single_terminal_consonants.
Instance Method Summary collapse
-
#initialize ⇒ Conjugations
constructor
A new instance of Conjugations.
- #irregular(infinitive, preterite = nil, past_participle = nil, &blk) ⇒ Object
- #single_terminal_consonant(infinitive) ⇒ Object
Constructor Details
#initialize ⇒ Conjugations
Returns a new instance of Conjugations.
10 11 12 |
# File 'lib/verbs/conjugator.rb', line 10 def initialize @irregulars, @single_terminal_consonants, @copulars = {}, [], {} end |
Instance Attribute Details
#copulars ⇒ Object (readonly)
Returns the value of attribute copulars.
8 9 10 |
# File 'lib/verbs/conjugator.rb', line 8 def copulars @copulars end |
#irregulars ⇒ Object (readonly)
Returns the value of attribute irregulars.
8 9 10 |
# File 'lib/verbs/conjugator.rb', line 8 def irregulars @irregulars end |
#single_terminal_consonants ⇒ Object (readonly)
Returns the value of attribute single_terminal_consonants.
8 9 10 |
# File 'lib/verbs/conjugator.rb', line 8 def single_terminal_consonants @single_terminal_consonants end |
Instance Method Details
#irregular(infinitive, preterite = nil, past_participle = nil, &blk) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/verbs/conjugator.rb', line 14 def irregular(infinitive, preterite = nil, past_participle = nil, &blk) if block_given? irregular = ::Verbs::Verb.new infinitive, &blk else raise ArgumentError, "Standard irregular verbs must specify preterite and past participle forms" unless preterite and past_participle irregular = ::Verbs::Verb.new infinitive, :preterite => preterite, :past_participle => past_participle end @irregulars[infinitive] = irregular end |
#single_terminal_consonant(infinitive) ⇒ Object
24 25 26 |
# File 'lib/verbs/conjugator.rb', line 24 def single_terminal_consonant(infinitive) @single_terminal_consonants << infinitive end |