diff --git a/lib/rackstash/fields/array.rb b/lib/rackstash/fields/array.rb index 8cc16e0..2de16bd 100644 --- a/lib/rackstash/fields/array.rb +++ b/lib/rackstash/fields/array.rb @@ -107,8 +107,9 @@ module Rackstash # # @param array [Array, ::Array, Proc] an array of values. Each value is # normalized before being added to `self`. - # @param scope [Object] if `array` or any of its (deeply-nested) values is - # a proc, it will be called in the instance scope of this object. + # @param scope [Object, nil] if `array` or any of its (deeply-nested) + # values is a proc, it will be called in the instance scope of this + # object (when given). # @return [self] def concat(array, scope: nil) array = Array(normalize(array, wrap: false, scope: scope)) diff --git a/lib/rackstash/fields/hash.rb b/lib/rackstash/fields/hash.rb index 5eefb71..220b6af 100644 --- a/lib/rackstash/fields/hash.rb +++ b/lib/rackstash/fields/hash.rb @@ -100,8 +100,9 @@ module Rackstash # is a proc, it will get called and its result is used instead # @param force [Boolean] `true` to raise an `ArgumentError` when trying to # set a forbidden key, `false` to silently ingnore these key-value pairs - # @param scope [Object] if `hash` or any of its (deeply-nested) values is - # a proc, it will be called in the instance scope of this object. + # @param scope [Object, nil] if `hash` or any of its (deeply-nested) + # values is a proc, it will be called in the instance scope of this + # object (when given). # # @yield [key, old_val, new-val] if a block is given and there is a # duplicate key, we call the block and use its return value as the value @@ -139,9 +140,9 @@ module Rackstash # is a proc, it will get called and its result is used instead # @param force [Boolean] `true` to raise an `ArgumentError` when trying to # set a forbidden key, `false` to silently ingnore these key-value pairs - # @param scope [Object] if `hash` or any of its (deeply-nested) values is - # a proc, it will be called in the instance scope of this object. - # + # @param scope [Object, nil] if `hash` or any of its (deeply-nested) + # values is a proc, it will be called in the instance scope of this + # object (when given). # @yield [key, old_val, new-val] if a block is given and there is a # duplicate key, we call the block and use its return value as the value # to insert