You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: validations.rb
    path of file: ./repos/hyperstack/ruby/hyper-operation/lib/hyper-operation/railway
    
    the code of the file until where you have to start completion: module Hyperstack
  class Operation
    class Railway

      def validations
        self.class.validations
      end

      def add_validation_error(i, e)
        @operation.add_error("param validation #{i+1}", :validation_error, e.to_s)
      end

      class << self
        def validations
          @v
    
      def process_validations
        validations.each_with_index do |validator, i|
          begin
            validator = @operation.method(validator) if validator.is_a? Symbol
            next if @operation.instance_exec(&validator)
            add_validation_error(i, "param validation #{i+1} failed")
          rescue Exit => e
            case e.state
            when :success
              add_validation_error(i, "illegal use of succeed! in validation")
            when :failed
              add_validation_error(i, "param validation #{i+1} aborted")
            end
            @state = :abort
            return # break does not work in Opal
          rescue AccessViolation => e
            add_validation_error(i, e)
            @state = :abort
            @last_result = e
            return # break does not work in Opal
          rescue Exception => e
            add_validation_error(i, e)
          end
        end
      ensure
        if @operation.has_errors?
          @last_result ||= ValidationException.new(@operation.instance_variable_get('@errors'))
          @state ||= :failed
        end