1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Indentation >>

This commit is contained in:
Akira Matsuda 2019-06-22 05:22:07 +09:00
parent ef1dbd8cc7
commit a2a515d9de

View file

@ -205,18 +205,18 @@ class Module
if allow_nil
method_def = [
"def #{method_prefix}#{method}(#{definition})",
"_ = #{to}",
"if !_.nil? || nil.respond_to?(:#{method})",
" _.#{method}(#{definition})",
"end",
"end"
" _ = #{to}",
" if !_.nil? || nil.respond_to?(:#{method})",
" _.#{method}(#{definition})",
" end",
"end"
].join ";"
else
exception = %(raise DelegationError, "#{self}##{method_prefix}#{method} delegated to #{to}.#{method}, but #{to} is nil: \#{self.inspect}")
method_def = [
"def #{method_prefix}#{method}(#{definition})",
" _ = #{to}",
" _ = #{to}",
" _.#{method}(#{definition})",
"rescue NoMethodError => e",
" if _.nil? && e.name == :#{method}",