Method: Chronic::Parser#parse

Defined in:
lib/chronic/parser.rb

#parse(text) ⇒ Object

Parse “text” with the given options Returns either a Time or Chronic::Span, depending on the value of options



59
60
61
62
63
64
65
66
# File 'lib/chronic/parser.rb', line 59

def parse(text)
  tokens = tokenize(text, options)
  span = tokens_to_span(tokens, options.merge(:text => text))

  puts "+#{'-' * 51}\n| #{tokens}\n+#{'-' * 51}" if Chronic.debug

  guess(span, options[:guess]) if span
end