Sha256: 222f7db1b9bf175c2c0db7d4118eecedaf0c7e988ac1ccb32a4cbe80e16ab50e

Contents?: true

Size: 682 Bytes

Versions: 6

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

module Nocode
  module Steps
    module Dataset
      # Combine all specified from_registers into one dataset and place in the specified
      # to_register.  If anything currently exists in the to_register then it will be coerced
      # to an array and prepended to the beginning.
      class Coalesce < Step
        option :from_registers, :to_register

        def perform
          registers[to_register_option] = array(registers[to_register_option])

          array(from_registers_option).each do |from_register|
            registers[to_register_option] += array(registers[from_register])
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nocode-0.0.10 lib/nocode/steps/dataset/coalesce.rb
nocode-0.0.9 lib/nocode/steps/dataset/coalesce.rb
nocode-0.0.8 lib/nocode/steps/dataset/coalesce.rb
nocode-0.0.7 lib/nocode/steps/dataset/coalesce.rb
nocode-0.0.6 lib/nocode/steps/dataset/coalesce.rb
nocode-0.0.5 lib/nocode/steps/dataset/coalesce.rb