Method: Treat::Workers::Inflectors::Ordinalizers::Linguistics.ordinal

Defined in:
lib/treat/workers/inflectors/ordinalizers/linguistics.rb

.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, options = {})
  options = DefaultOptions.merge(options)
  lang = entity.language
  code = Treat::Loaders::Linguistics.load(lang)
  entity.to_s.send(code).ordinate
end