Class: Translator::SplitterLiteralDate

Inherits:
Step
  • Object
show all
Defined in:
lib/natural-date/translator/splitter_literal_date.rb

Instance Attribute Summary

Attributes inherited from Step

#language_bundle

Instance Method Summary collapse

Instance Method Details

#map(tokens, reference_date) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/natural-date/translator/splitter_literal_date.rb', line 3

def map tokens, reference_date
  tokens.map do |token|
    if token.include? '/'
      translate_day_and_month(token.split('/'))
    else
      [token]
    end
  end.flatten
end