Sha256: 633879bede1fc2dac0d37c219c1896d7194101e3316fed9c877321f4bce2317f

Contents?: true

Size: 440 Bytes

Versions: 7

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true

module Nocode
  module Steps
    module Io
      # Read a file from disk and place its contents in a register.
      class Read < Step
        option :path,
               :register

        def perform
          data = File.read(path)

          registers[register_option] = data
        end

        private

        def path
          File.join(*array(path_option))
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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