aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2019-06-22 05:22:07 +0900
committerAkira Matsuda <ronnie@dio.jp>2019-06-22 05:22:07 +0900
commita2a515d9de4ef0ddf4d78b05fcb0b838d2e1b5e3 (patch)
treec4f8491f7142fca2dcef15bbec26e969e773d8b5 /activesupport/lib
parentef1dbd8cc725f3df9080870ce58afd7d822df98a (diff)
downloadrails-a2a515d9de4ef0ddf4d78b05fcb0b838d2e1b5e3.tar.gz
rails-a2a515d9de4ef0ddf4d78b05fcb0b838d2e1b5e3.tar.bz2
rails-a2a515d9de4ef0ddf4d78b05fcb0b838d2e1b5e3.zip
Indentation >>
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb
index b8996ecb10..54271a3970 100644
--- a/activesupport/lib/active_support/core_ext/module/delegation.rb
+++ b/activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -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}",