Sha256: 6920c321fe907121b7b88f82c53021e2e56fedfad6b1e069171d666a09520fcf
Contents?: true
Size: 530 Bytes
Versions: 10
Compression:
Stored size: 530 Bytes
Contents
module Chronic class TimeZone < Tag #:nodoc: def self.scan(tokens) tokens.each_index do |i| if t = self.scan_for_all(tokens[i]) then tokens[i].tag(t); next end end tokens end def self.scan_for_all(token) scanner = {/[PMCE][DS]T/i => :tz, /(tzminus)?\d{4}/ => :tz} scanner.keys.each do |scanner_item| return self.new(scanner[scanner_item]) if scanner_item =~ token.word end return nil end def to_s 'timezone' end end end
Version data entries
10 entries across 10 versions & 9 rubygems