Class: ChronicDuration
Class Method Summary collapse
Class Method Details
.parse_with_chinese_support(str) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/opendmm/utils.rb', line 27 def parse_with_chinese_support(str) case str when /(\d+)\s*分\s*(\d+)\s*秒/ return $1.to_i.minutes + $2.to_i.seconds when /(\d+)(\s*)分/ return $1.to_i.minutes else return parse_without_chinese_support(str) end end |