class Chronic::Scalar

def self.scan_for_months(token, post_token)

Returns:
  • (ScalarMonth, nil) -

Parameters:
  • post_token (Token) --
  • token (Token) --
def self.scan_for_months(token, post_token)
  if token.word =~ /^\d\d?$/
    toi = token.word.to_i
    unless toi > 12 || toi < 1 || (post_token && DAY_PORTIONS.include?(post_token.word))
      return ScalarMonth.new(toi)
    end
  end
end