mirror of
https://github.com/meineerde/rackstash.git
synced 2025-12-23 16:21:11 +00:00
Clarify how the scope parameter works on field methods
This commit is contained in:
parent
057cf2c8f7
commit
b9a1b0c386
@ -107,8 +107,9 @@ module Rackstash
|
|||||||
#
|
#
|
||||||
# @param array [Array, ::Array, Proc] an array of values. Each value is
|
# @param array [Array, ::Array, Proc] an array of values. Each value is
|
||||||
# normalized before being added to `self`.
|
# normalized before being added to `self`.
|
||||||
# @param scope [Object] if `array` or any of its (deeply-nested) values is
|
# @param scope [Object, nil] if `array` or any of its (deeply-nested)
|
||||||
# a proc, it will be called in the instance scope of this object.
|
# values is a proc, it will be called in the instance scope of this
|
||||||
|
# object (when given).
|
||||||
# @return [self]
|
# @return [self]
|
||||||
def concat(array, scope: nil)
|
def concat(array, scope: nil)
|
||||||
array = Array(normalize(array, wrap: false, scope: scope))
|
array = Array(normalize(array, wrap: false, scope: scope))
|
||||||
|
|||||||
@ -100,8 +100,9 @@ module Rackstash
|
|||||||
# is a proc, it will get called and its result is used instead
|
# is a proc, it will get called and its result is used instead
|
||||||
# @param force [Boolean] `true` to raise an `ArgumentError` when trying to
|
# @param force [Boolean] `true` to raise an `ArgumentError` when trying to
|
||||||
# set a forbidden key, `false` to silently ingnore these key-value pairs
|
# 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
|
# @param scope [Object, nil] if `hash` or any of its (deeply-nested)
|
||||||
# a proc, it will be called in the instance scope of this object.
|
# 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
|
# @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
|
# 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
|
# is a proc, it will get called and its result is used instead
|
||||||
# @param force [Boolean] `true` to raise an `ArgumentError` when trying to
|
# @param force [Boolean] `true` to raise an `ArgumentError` when trying to
|
||||||
# set a forbidden key, `false` to silently ingnore these key-value pairs
|
# 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
|
# @param scope [Object, nil] if `hash` or any of its (deeply-nested)
|
||||||
# a proc, it will be called in the instance scope of this object.
|
# 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
|
# @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
|
# duplicate key, we call the block and use its return value as the value
|
||||||
# to insert
|
# to insert
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user