Sha256: 31b9bf0871553d33950c83cfd984cd70513da28009e5f03e8d652d883afdce4f

Contents?: true

Size: 638 Bytes

Versions: 7

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true

module Nocode
  module Steps
    module Deserialize
      # Take a specified register and parse it as YAML to produce Ruby object(s).
      #
      # NOTE: This will throw an error if unsafe YAML types are used.  The only allowed types are
      # array, hash, strings, numbers, booleans, nil.  See:
      # https://ruby-doc.org/stdlib-2.6.1/libdoc/psych/rdoc/Psych.html#method-c-safe_load
      class Yaml < Step
        option :register

        def perform
          input = registers[register_option]

          registers[register_option] = YAML.safe_load(input)
        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/yaml.rb
nocode-0.0.9 lib/nocode/steps/deserialize/yaml.rb
nocode-0.0.8 lib/nocode/steps/deserialize/yaml.rb
nocode-0.0.7 lib/nocode/steps/deserialize/yaml.rb
nocode-0.0.6 lib/nocode/steps/deserialize/yaml.rb
nocode-0.0.5 lib/nocode/steps/deserialize/yaml.rb
nocode-0.0.4 lib/nocode/steps/deserialize/yaml.rb