module Clayoven::Claytext::Transforms::Util
Miscellanous utilities
Constants
- ROMAN_NUMERALS
For roman-numeralized lists like (i), (ii)
- ROUGE_LEXERS
Lexers in Rouge
Public Class Methods
to_arabic(str)
click to toggle source
Do a roman to arabic conversion
# File lib/clayoven/util.rb, line 64 def self.to_arabic(str) result = 0 ROMAN_NUMERALS.each_value do |roman| while str.start_with?(roman) result += ROMAN_NUMERALS.invert[roman] str = str.slice(roman.length, str.length) end end result end