vendor/bundle/ruby/3.0.0/gems/brakeman-5.2.2/bundle/ruby/2.7.0/gems/ruby2ruby-2.4.4/lib/ruby2ruby.rb
##
# Utility method to generate ether a module or class.
Utility method to generate ether a module or class.
Utility method to generate ether a module or class .
def util_module_or_class exp, is_class = false
    result = []
    _, name, *body = exp
    superk = body.shift if is_class
    name = process name if Sexp === name
    result << name
    if superk then
      superk = process superk
      result << " < #{superk}" if superk
    end
    result << "\n"
    body = body.map { |sexp|
      process(sexp).chomp
    }
    body = unless body.empty? then
             indent(body.join("\n\n")) + "\n"
           else
             ""
           end
    result << body
    result << "end"
    result.join
  end
def util_module_or_class exp , is_class = false result = [ ] _ , name , * body = exp superk = body . shift if is_class name = process name if Sexp === name result << name if superk then superk = process superk result << " < #{superk}" if superk end result << "\n" body = body . map { | sexp | process ( sexp ) . chomp } body = unless body . empty? then indent ( body . join ( "\n\n" ) ) + "\n" else "" end result << body result << "end" result . join end
Utility method to generate ether a module or class.
Utility method to generate ether a module or class .
exp
is_class