1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-10-17 14:01:01 +00:00

Ensure the stored object_type of a ClassRegistry is always frozen

This commit is contained in:
Holger Just 2020-06-07 16:44:13 +02:00
parent aa5a496a18
commit 27847ac6ef
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ module Rackstash
# @param object_type [#to_s] the human-readable singular name of the
# registered objects. It is used to build more useful error messages.
def initialize(object_type = 'class')
@object_type = object_type.to_s
@object_type = object_type.to_s.dup.freeze
@registry = {}
end

View File

@ -52,7 +52,7 @@ module Rackstash
# @return [ClassRegistry] the {ClassRegistry} object which allows to
# register and retrieve available filter classes
def registry
@registry ||= Rackstash::ClassRegistry.new('filter'.freeze)
@registry ||= Rackstash::ClassRegistry.new('filter')
end
# Create a new filter instance from the specified class and the given