Module: Sekki24::Lunisolar::MonthBuilder

Defined in:
lib/sekki24/lunisolar/month_builder.rb

Defined Under Namespace

Classes: RawMonth

Constant Summary collapse

PRINCIPAL_LONGITUDES =
(0.step(330, 30).to_a).freeze

Class Method Summary collapse

Class Method Details

.build(years, timezone) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/sekki24/lunisolar/month_builder.rb', line 23

def build(years, timezone)
  terms = principal_terms(years, timezone)
  months = build_raw_months(years, timezone, terms)
  assign_month_numbers(months, terms)
  assign_lunar_years(months)
  months.filter_map { |raw| build_month(raw) }.freeze
end

.clear_cache!Object



31
32
33
# File 'lib/sekki24/lunisolar/month_builder.rb', line 31

def clear_cache!
  @cache_mutex.synchronize { @principal_cache.clear }
end