1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-12-19 15:01:12 +00:00

Fix typos and omissions in the documentation of the Replace filter

This commit is contained in:
Holger Just 2017-09-23 00:38:22 +02:00
parent c383e2b3dc
commit d66408d333

View File

@ -8,10 +8,13 @@
module Rackstash
module Filters
# Replace fields in the given event with new values. A new value can be
# specified as either a fixed value or as a Proc (or any other object
# specified as either a fixed value or as a `Proc` (or any other object
# responding to `call`). In the latter case, the callable object will be
# called with the event as its argument. It is then expectd to return the
# new value which is set on the key
# called with the event as its argument. It is then expected to return the
# new value which is set on the key.
#
# If a specified field does not exist in the event hash, it will be created
# with the given (or calculated) value anyway.
#
# @example
# Rackstash::Flow.new(STDOUT) do
@ -20,8 +23,9 @@ module Rackstash
# }
# end
#
# You should make sure to only set a new object of the basic types here,
# namely `String`, `Integer`, `Float`, `nil`, `true`, or `false`.
# You should make sure to only set a new object of one of the basic types
# here, namely `String`, `Integer`, `Float`, `Hash`, `Array`, `nil`, `true`,
# or `false`.
class Replace
# @param spec [Hash<#to_s => #call,Object>] a `Hash` specifying new field
# values for the named keys. Values can be given in the form of a fixed
@ -34,9 +38,7 @@ module Rackstash
end
end
# Replace field values in the event to a new value. If a specified field
# does not exist in the event hah, it will be created with the goven (or
# calculated) value anyway.
# Replace or set fields in the event to a new value.
#
# @param event [Hash] an event hash
# return [Hash] the given `event` with the fields renamed