Class: Emendate::MonthDayAnalyzer

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

Instance Attribute Summary collapse

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(n1, n2, y) ⇒ MonthDayAnalyzer

Returns a new instance of MonthDayAnalyzer.



17
18
19
20
21
22
23
# File 'lib/emendate/month_day_analyzer.rb', line 17

def initialize(n1, n2, y)
  @n1 = n1
  @n2 = n2
  @y = y
  @opt = Emendate.options.ambiguous_month_day
  @warnings = []
end

Instance Attribute Details

#dayObject (readonly)

Returns the value of attribute day.



9
10
11
# File 'lib/emendate/month_day_analyzer.rb', line 9

def day
  @day
end

#monthObject (readonly)

Returns the value of attribute month.



9
10
11
# File 'lib/emendate/month_day_analyzer.rb', line 9

def month
  @month
end

#warningsObject (readonly)

Returns the value of attribute warnings.



9
10
11
# File 'lib/emendate/month_day_analyzer.rb', line 9

def warnings
  @warnings
end

Class Method Details

.callObject



12
13
14
# File 'lib/emendate/month_day_analyzer.rb', line 12

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

Instance Method Details

#callObject



25
26
27
28
# File 'lib/emendate/month_day_analyzer.rb', line 25

def call
  analyze
  self
end