Sha256: fb3ac3c69e7e729e487055f761ea354b793360634b82b55910c21d854fd49555

Contents?: true

Size: 411 Bytes

Versions: 7

Compression:

Stored size: 411 Bytes

Contents

# frozen_string_literal: true

module Nocode
  module Steps
    module Deserialize
      # take a specified register and parse it as a CSV to produce an array of hashes.
      class Csv < Step
        option :register

        def perform
          input = registers[register_option].to_s

          registers[register_option] = CSV.new(input, headers: true).map(&:to_h)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nocode-0.0.10 lib/nocode/steps/deserialize/csv.rb
nocode-0.0.9 lib/nocode/steps/deserialize/csv.rb
nocode-0.0.8 lib/nocode/steps/deserialize/csv.rb
nocode-0.0.7 lib/nocode/steps/deserialize/csv.rb
nocode-0.0.6 lib/nocode/steps/deserialize/csv.rb
nocode-0.0.5 lib/nocode/steps/deserialize/csv.rb
nocode-0.0.4 lib/nocode/steps/deserialize/csv.rb