mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Expose global filter names
This commit is contained in:
@@ -14,6 +14,10 @@ module Liquid
|
|||||||
strainer_from_cache(filters).new(context)
|
strainer_from_cache(filters).new(context)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def global_filter_names
|
||||||
|
GlobalCache.filter_method_names
|
||||||
|
end
|
||||||
|
|
||||||
GlobalCache = Class.new(StrainerTemplate)
|
GlobalCache = Class.new(StrainerTemplate)
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ module Liquid
|
|||||||
subclass.instance_variable_set(:@filter_methods, @filter_methods.dup)
|
subclass.instance_variable_set(:@filter_methods, @filter_methods.dup)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filter_method_names
|
||||||
|
filter_methods.map(&:to_s).to_a
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def filter_methods
|
def filter_methods
|
||||||
|
|||||||
Reference in New Issue
Block a user