This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/lib/theme_modifier_helper.rb
2021-06-21 11:06:58 +08:00

13 lines
350 B
Ruby

# 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) do
Theme.lookup_modifier(@theme_ids, modifier)
end
end
end