Class: Cmdlet::Inflection::Ordinal
- Inherits:
-
BaseCmdlet
- Object
- BaseCmdlet
- Cmdlet::Inflection::Ordinal
- Defined in:
- lib/cmdlet/inflection/ordinal.rb
Overview
Ordinal: The suffix that should be added to a number to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th
Instance Method Summary collapse
-
#call(value) ⇒ String
Ordinal suffix that would be required for a number.
Methods inherited from BaseCmdlet
Instance Method Details
#call(value) ⇒ String
Returns ordinal suffix that would be required for a number.
11 12 13 14 15 16 17 |
# File 'lib/cmdlet/inflection/ordinal.rb', line 11 def call(value) return '' if value.nil? value = value.to_i if value.is_a? String value.ordinal end |