class Chronic::Tag

they match specific criteria
Tokens are tagged with subclassed instances of this class when

def initialize(type)

Parameters:
  • type (Symbol) --
def initialize(type)
  @type = type
end

def scan_for(token, klass, items={})

Returns:
  • (Object, nil) - either a new instance of `klass` or `nil` if

Parameters:
  • items (Regexp, Hash) --
  • klass (Class) -- The class instance to create
  • token (Token) --
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

def start=(s)

Parameters:
  • s (Time) -- Set the start timestamp for this Tag
def start=(s)
  @now = s
end