Class: Nocode::Steps::Deserialize::Csv

Inherits:
Nocode::Step show all
Defined in:
lib/nocode/steps/deserialize/csv.rb

Overview

take a specified register and parse it as a CSV to produce an array of hashes.

Constant Summary

Constants included from Util::Optionable

Util::Optionable::OPTION_PREFIX

Instance Attribute Summary

Attributes inherited from Nocode::Step

#context, #name, #options, #type

Instance Method Summary collapse

Methods inherited from Nocode::Step

#initialize

Methods included from Util::Optionable

included, #method_missing, #options, #respond_to_missing?

Methods included from Util::Arrayable

#array

Constructor Details

This class inherits a constructor from Nocode::Step

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Nocode::Util::Optionable

Instance Method Details

#performObject



10
11
12
13
14
# File 'lib/nocode/steps/deserialize/csv.rb', line 10

def perform
  input = registers[register_option].to_s

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