Tokens are tagged with subclassed instances of this class when they match specific criteria.
type - The Symbol type of this tag.
# File lib/chronic/tag.rb, line 9 def initialize(type) @type = type end
# File lib/chronic/tag.rb, line 21 def scan_for(token, klass, items={}) case items when Regexp return klass.new(token.word) if items =~ token.word when Hash items.each do |item, symbol| return klass.new(symbol) if item =~ token.word end end nil end
time - Set the start Time for this Tag.
# File lib/chronic/tag.rb, line 14 def start=(time) @now = time end