0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/lib/theme_modifier_helper.rb
2023-01-09 12:10:19 +00:00

10 lines
337 B
Ruby
Vendored

# frozen_string_literal: true
class ThemeModifierHelper
def initialize(request: nil, theme_ids: nil)
@theme_ids = theme_ids || Theme.transform_ids(request&.env&.[](:resolved_theme_id))
end
ThemeModifierSet.modifiers.keys.each do |modifier|
define_method(modifier) { Theme.lookup_modifier(@theme_ids, modifier) }
end
end