def process_call exp
return exp if process_call_defn? exp
target = exp.target
if sexp? target
target = process target
end
method = exp.method
first_arg = exp.first_arg
last_arg = exp.last_arg
if @current_method.nil? and target.nil? and @current_class
if first_arg.nil?
case method
when :private, :protected, :public
@visibility = method
when :protect_from_forgery
@current_class.options[:protect_from_forgery] = true
else
end
else
case method
when :include
if @current_class
concern = class_name(first_arg)
@current_class.add_include concern
process_concern concern
end
when :before_filter, :append_before_filter, :before_action, :append_before_action
if node_type? exp.first_arg, :iter
add_lambda_filter exp
else
@current_class.add_before_filter exp
end
when :prepend_before_filter, :prepend_before_action
if node_type? exp.first_arg, :iter
add_lambda_filter exp
else
@current_class.prepend_before_filter exp
end
when :skip_before_filter, :skip_filter, :skip_before_action, :skip_action_callback
@current_class.skip_filter exp
when :layout
if string? last_arg
name = last_arg.value.to_s
if @app_tree.layout_exists?(name)
@current_class.layout = "layouts/#{name}"
else
Brakeman.debug "[Notice] Layout not found: #{name}"
end
elsif node_type? last_arg, :nil, :false
@current_class.layout = false
end
else
@current_class.add_option method, exp
end
end
exp
elsif target == nil and method == :render
make_render exp
elsif exp == FORMAT_HTML and context[1] != :iter
call = Sexp.new :render, :default, @current_method
call.line(exp.line)
call
else
call = make_call target, method, process_all!(exp.args)
call.line(exp.line)
call
end
end