Merge pull request #1600 from Shopify/zoey/expose-filter-names

Expose global filter names
This commit is contained in:
Zoey Lan
2022-07-21 12:55:02 -06:00
committed by GitHub
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -14,6 +14,10 @@ module Liquid
strainer_from_cache(filters).new(context)
end
def global_filter_names
GlobalCache.filter_method_names
end
GlobalCache = Class.new(StrainerTemplate)
private
+4
View File
@@ -36,6 +36,10 @@ module Liquid
subclass.instance_variable_set(:@filter_methods, @filter_methods.dup)
end
def filter_method_names
filter_methods.map(&:to_s).to_a
end
private
def filter_methods