Sha256: 0256ae5889cea063100a0f0d5f048b09469f426e71448c8828d0040436ad71e3
Contents?: true
Size: 603 Bytes
Versions: 29
Compression:
Stored size: 603 Bytes
Contents
# frozen_string_literal: true module Cmdlet # Inflection handling routines, eg. pluralize, singular, ordinalize module Inflection # Ordinal: The suffix that should be added to a number to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th class Ordinal < Cmdlet::BaseCmdlet # # @param [String|Int] value - value - numeric value # @return [String] ordinal suffix that would be required for a number def call(value) return '' if value.nil? value = value.to_i if value.is_a? String value.ordinal end end end end
Version data entries
29 entries across 29 versions & 1 rubygems