2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00
discourse/lib/theme_modifier_helper.rb

13 lines
350 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class ThemeModifierHelper
def initialize(request: nil, theme_ids: nil)
2021-06-18 10:16:26 +08:00
@theme_ids = theme_ids || Theme.transform_ids(request&.env&.[](:resolved_theme_id))
end
ThemeModifierSet.modifiers.keys.each do |modifier|
define_method(modifier) do
Theme.lookup_modifier(@theme_ids, modifier)
end
end
end