class BBS::Season

The time of day, the season and the holidays at a place, for choosing the layers of a BBS::Art: the sky of a scene at dawn, by day, at dusk or at night, snow in winter, a pumpkin at the end of October, fireworks on New Year’s Eve, bunting in the week of a game jam.

Pure and deterministic: everything follows from the instant (at, default now), the time zone and the place, so a test passes the time it wants.

s = BBS::Season.now                         # Budapest, now
s.time_of_day                               # => :night
s.layers                                    # => [:snow]
art.with(*s.layers)

BBS::Season.now(at: Time.utc(2026, 12, 31, 21), jam: Date.new(2027, 1, 8)..Date.new(2027, 1, 10))
# => fireworks and snow, at night

The times of day follow the sun: :dawn is the hour around sunrise (TWILIGHT minutes either side), :day until the hour around sunset, :dusk, and :night after it. Sunrise and sunset are worked out for latitude and longitude (Budapest by default) to within a few minutes.

The layers, a Symbol each:

:snow

December to February

:pumpkin

PUMPKIN: the last week of October

:fireworks

New Year’s Eve, and the small hours of New Year’s Day (until FIREWORKS_UNTIL)

:bunting

the days of jam, a Range of Date