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

View File

@@ -170,7 +170,7 @@ module Liquid
def disable_tags(context, tags, &block)
return yield if tags.empty?
context.registers['disabled_tags'].disable(tags, &block)
context.registers[:disabled_tags].disable(tags, &block)
end
def raise_if_resource_limits_reached(context, length)

View File

@@ -28,5 +28,5 @@ module Liquid
end
end
Template.add_register('disabled_tags', DisabledTags.new)
Template.add_register(:disabled_tags, DisabledTags.new)
end

View File

@@ -47,7 +47,7 @@ module Liquid
end
def disabled?(context)
context.registers['disabled_tags'].disabled?(tag_name)
context.registers[:disabled_tags].disabled?(tag_name)
end
def disabled_error_message

View File

@@ -93,7 +93,7 @@ module Liquid
end
def add_register(name, klass)
registers[name.to_s] = klass
registers[name.to_sym] = klass
end
def registers