discourse/lib/theme_modifier_helper.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
331 B
Ruby
Raw Normal View History

# 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