Class: Emendate::DatePartTagger

Inherits:
Object
  • Object
show all
Includes:
DateUtils
Defined in:
lib/emendate/date_part_tagger.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DateUtils

#expand_shorter_digits, #is_range?, #max_season, #min_season, #month_abbr_literal, #month_literal, #possible_range?, #valid_date?, #valid_day?, #valid_month?, #valid_month_or_season?, #valid_season?, #valid_year?

Constructor Details

#initialize(tokens) ⇒ DatePartTagger

Returns a new instance of DatePartTagger.



18
19
20
21
# File 'lib/emendate/date_part_tagger.rb', line 18

def initialize(tokens)
  @result = Emendate::SegmentSet.new.copy(tokens)
  @taggable = true
end

Class Method Details

.callObject



13
14
15
# File 'lib/emendate/date_part_tagger.rb', line 13

def call(...)
  new(...).call
end

Instance Method Details

#callObject



23
24
25
26
27
28
# File 'lib/emendate/date_part_tagger.rb', line 23

def call
  _years_tagged = yield tag_years
  _tagged = yield tag

  Success(result)
end