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:
parent
aa5a496a18
commit
27847ac6ef
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user