Class: Strings::Inflection::Verb
- Defined in:
- lib/strings/inflection/verb.rb
Instance Attribute Summary
Attributes inherited from Term
Instance Method Summary collapse
-
#plural ⇒ String
Inflect a word to its plural form.
-
#singular ⇒ String
Inflect a word to its singular form.
-
#uninflected? ⇒ Boolean
private
Check if word is uninflected.
Methods inherited from Term
[], #find_match, #initialize, #plural?, #singular?, #to_s
Constructor Details
This class inherits a constructor from Strings::Inflection::Term
Instance Method Details
#plural ⇒ String
Inflect a word to its plural form
47 48 49 50 51 |
# File 'lib/strings/inflection/verb.rb', line 47 def plural return word if word.to_s.empty? || uninflected? find_match(Verbs.plurals) || word end |
#singular ⇒ String
Inflect a word to its singular form
31 32 33 34 35 |
# File 'lib/strings/inflection/verb.rb', line 31 def singular return word if word.to_s.empty? || uninflected? find_match(Verbs.singulars) || word end |
#uninflected? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Check if word is uninflected
17 18 19 |
# File 'lib/strings/inflection/verb.rb', line 17 def uninflected? Verbs.uninflected.include?(word) end |