Sha256: d4d929416d4e09bd80739f4c7d029740f35d2161ad88f9bcbbc85057b13019ee
Contents?: true
Size: 401 Bytes
Versions: 9
Compression:
Stored size: 401 Bytes
Contents
module Bioshogi module Parser class TimeParser def initialize(time_str) @time_str = time_str end def to_time case_a || case_b end private def case_a Time.parse(@time_str) rescue nil end def case_b values = @time_str.scan(/\d+/).collect(&:to_i) Time.local(*values) rescue nil end end end end
Version data entries
9 entries across 9 versions & 1 rubygems