2020-03-11 09:30:45 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
class ThemeModifierHelper
|
|
|
|
def initialize(request: nil, theme_ids: nil)
|
|
|
|
@theme_ids = theme_ids || request&.env&.[](:resolved_theme_ids)
|
|
|
|
end
|
|
|
|
|
2020-03-12 12:35:28 -04:00
|
|
|
ThemeModifierSet.modifiers.keys.each do |modifier|
|
2020-03-11 09:30:45 -04:00
|
|
|
define_method(modifier) do
|
|
|
|
Theme.lookup_modifier(@theme_ids, modifier)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|