mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 05:50:14 +08:00
13 lines
330 B
Ruby
13 lines
330 B
Ruby
# frozen_string_literal: true
|
|
class ThemeModifierHelper
|
|
def initialize(request: nil, theme_ids: nil)
|
|
@theme_ids = theme_ids || request&.env&.[](:resolved_theme_ids)
|
|
end
|
|
|
|
ThemeModifierSet.modifiers.keys.each do |modifier|
|
|
define_method(modifier) do
|
|
Theme.lookup_modifier(@theme_ids, modifier)
|
|
end
|
|
end
|
|
end
|