Method: Streamer::Stream#assign_each
- Defined in:
- lib/streamer/stream.rb
#assign_each(list:, property:, value: nil, function: nil) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/streamer/stream.rb', line 38 def assign_each(list:, property:, value: nil, function: nil) payload.dig(*list.split('.')).each do |item| item[property] = value unless value.nil? item[property] = functor(replace_terms(item, function)).call if function end self end |