Class: Nocode::Steps::Dataset::Prepend

Inherits:
Nocode::Step show all
Defined in:
lib/nocode/steps/dataset/prepend.rb

Overview

Add entries specified in the options to the beginning of the specified register’s existing entries.

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



11
12
13
14
15
16
17
# File 'lib/nocode/steps/dataset/prepend.rb', line 11

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

  array(entries_option).reverse_each do |entry|
    registers[register_option].prepend(entry)
  end
end