Change registers to by symbols (#1178)

This commit is contained in:
Mike Angell
2019-09-27 04:32:24 +10:00
committed by GitHub
parent 0db9c56f34
commit 1aa7d3d2ba
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -170,7 +170,7 @@ module Liquid
def disable_tags(context, tags, &block) def disable_tags(context, tags, &block)
return yield if tags.empty? return yield if tags.empty?
context.registers['disabled_tags'].disable(tags, &block) context.registers[:disabled_tags].disable(tags, &block)
end end
def raise_if_resource_limits_reached(context, length) def raise_if_resource_limits_reached(context, length)
+1 -1
View File
@@ -28,5 +28,5 @@ module Liquid
end end
end end
Template.add_register('disabled_tags', DisabledTags.new) Template.add_register(:disabled_tags, DisabledTags.new)
end end
+1 -1
View File
@@ -47,7 +47,7 @@ module Liquid
end end
def disabled?(context) def disabled?(context)
context.registers['disabled_tags'].disabled?(tag_name) context.registers[:disabled_tags].disabled?(tag_name)
end end
def disabled_error_message def disabled_error_message
+1 -1
View File
@@ -93,7 +93,7 @@ module Liquid
end end
def add_register(name, klass) def add_register(name, klass)
registers[name.to_s] = klass registers[name.to_sym] = klass
end end
def registers def registers