Class Fixnum
In: script/txt2html
Parent: Object

Methods

ordinal  

Public Instance methods

[Source]

# File script/txt2html, line 17
  def ordinal
    # teens
    return 'th' if (10..19).include?(self % 100)
    # others
    case self % 10
    when 1: return 'st'
    when 2: return 'nd'
    when 3: return 'rd'
    else    return 'th'
    end
  end

[Validate]