mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Change registers to by symbols (#1178)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -28,5 +28,5 @@ module Liquid
|
||||
end
|
||||
end
|
||||
|
||||
Template.add_register('disabled_tags', DisabledTags.new)
|
||||
Template.add_register(:disabled_tags, DisabledTags.new)
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user