Class: Treat::Workers::Inflectors::Ordinalizers::Linguistics
- Inherits:
-
Object
- Object
- Treat::Workers::Inflectors::Ordinalizers::Linguistics
- Defined in:
- lib/treat/workers/inflectors/ordinalizers/linguistics.rb
Overview
This class is a wrapper for the functions included in the ‘linguistics’ gem that allow to describe a number in words in ordinal form.
Project website: deveiate.org/projects/Linguistics/
Constant Summary collapse
- DefaultOptions =
{ :language => Treat.core.language.default }
Class Method Summary collapse
-
.ordinal(entity, options = {}) ⇒ Object
Desribe a number in words in ordinal form, using the ‘linguistics’ gem.
Class Method Details
permalink .ordinal(entity, options = {}) ⇒ Object
Desribe a number in words in ordinal form, using the ‘linguistics’ gem.
14 15 16 17 18 19 |
# File 'lib/treat/workers/inflectors/ordinalizers/linguistics.rb', line 14 def self.ordinal(entity, = {}) = DefaultOptions.merge() lang = entity.language code = Treat::Loaders::Linguistics.load(lang) entity.to_s.send(code).ordinate end |