module Romanize

Constants

LETTERS

Public Instance Methods

romanize() click to toggle source
# File lib/romanizer.rb, line 6
def romanize
  n = self
  raise ArgumentError, 'Numeral should be between 1 and 3999' if n < 1 || n > 3999
  LETTERS.map{|l,v| c, n = n.divmod v; l*c}.join ''
end