Sha256: 69503381d089813844ec0be559dec6c8baa6e3a3214b414c51137167c92124e1

Contents?: true

Size: 372 Bytes

Versions: 21

Compression:

Stored size: 372 Bytes

Contents

# frozen_string_literal: true

class NodeMutation::Helper
  # It iterates over all actions, and calls the given block with each action.
  def self.iterate_actions(actions, &block)
    actions.each do |action|
      if action.is_a?(NodeMutation::GroupAction)
        iterate_actions(action.actions, &block)
      else
        block.call(action)
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
node_mutation-1.24.4 lib/node_mutation/helper.rb
node_mutation-1.24.3 lib/node_mutation/helper.rb
node_mutation-1.24.2 lib/node_mutation/helper.rb
node_mutation-1.24.1 lib/node_mutation/helper.rb
node_mutation-1.24.0 lib/node_mutation/helper.rb
node_mutation-1.23.3 lib/node_mutation/helper.rb
node_mutation-1.23.2 lib/node_mutation/helper.rb
node_mutation-1.23.1 lib/node_mutation/helper.rb
node_mutation-1.23.0 lib/node_mutation/helper.rb
node_mutation-1.22.4 lib/node_mutation/helper.rb
node_mutation-1.22.3 lib/node_mutation/helper.rb
node_mutation-1.22.2 lib/node_mutation/helper.rb
node_mutation-1.22.1 lib/node_mutation/helper.rb
node_mutation-1.22.0 lib/node_mutation/helper.rb
node_mutation-1.21.6 lib/node_mutation/helper.rb
node_mutation-1.21.5 lib/node_mutation/helper.rb
node_mutation-1.21.4 lib/node_mutation/helper.rb
node_mutation-1.21.3 lib/node_mutation/helper.rb
node_mutation-1.21.2 lib/node_mutation/helper.rb
node_mutation-1.21.1 lib/node_mutation/helper.rb