lib/traject/macros/transformation.rb
# For each value in accumulator, remove all leading or trailing whitespace
# (unique aware). Like ruby #strip, but whitespace-aware
#
# @example
#     to_field "title", extract_marc("245"), strip
For each value in accumulator, remove all leading or trailing whitespace
(unique aware). Like ruby #strip, but whitespace-aware
For each value in accumulator remove all leading or trailing whitespace ( unique aware ) . Like ruby #strip but whitespace - aware
def strip
        lambda do |rec, acc|
          acc.collect! do |v|
            v.sub(/\A[[:space:]]+/,'').sub(/[[:space:]]+\Z/, '')
          end
        end
      end
def strip lambda do | rec , acc | acc . collect! do | v | v . sub ( / \A [[:space:]]+ / , '' ) . sub ( / [[:space:]]+ \Z / , '' ) end end end
For each value in accumulator, remove all leading or trailing whitespace
(unique aware).
For each value in accumulator remove all leading or trailing whitespace ( unique aware ) .
# unicode whitespace class aware
example
to_field "title", extract_marc("245"), strip
to_field " title " extract_marc ( " 245 " ) strip