class Translator::Normalizer
Public Instance Methods
map(tokens, reference_date)
click to toggle source
# File lib/natural-date/translator/normalizer.rb, line 3 def map tokens, reference_date tokens .map { |token| normalize(token) } end
Private Instance Methods
normalize(token)
click to toggle source
# File lib/natural-date/translator/normalizer.rb, line 10 def normalize token case token.first when :day then [token.first, token.last.to_s.split('_').last.to_i] when :month then [token.first, token.last.to_s.split('_').last.to_i] when :week_day then [token.first, token.last.to_s.split('_').last.to_i] else token end end