Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion logstash-core/lib/logstash/util/thread_safe_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module Util
module ThreadSafeAttributes
# Thread-safe lazy initialized attribute with a given (variable) name.
def lazy_init_attr(attribute, variable: "@#{attribute}".to_sym, &block)
raise ArgumentError.new("invalid attribute name: #{attribute}") unless attribute.match? /^[_A-Za-z]\w*$/
raise ArgumentError.new("invalid attribute name: #{attribute}") unless attribute.match? /\A[_A-Za-z]\w*\z/
raise ArgumentError.new('no block given') unless block_given?
send(:define_method, attribute.to_sym) do
if instance_variable_defined?(variable)
Expand Down