diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 20:20:22 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 20:20:22 +0200 |
commit | b326e82dc012d81e9698cb1f402502af1788c1e9 (patch) | |
tree | 6b6452129a5b6b684f3d44f21afd2b1bea83fa22 /actionview/lib/action_view/layouts.rb | |
parent | 80e66cc4d90bf8c15d1a5f6e3152e90147f00772 (diff) | |
download | rails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.gz rails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.bz2 rails-b326e82dc012d81e9698cb1f402502af1788c1e9.zip |
applies remaining conventions across the project
Diffstat (limited to 'actionview/lib/action_view/layouts.rb')
-rw-r--r-- | actionview/lib/action_view/layouts.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/actionview/lib/action_view/layouts.rb b/actionview/lib/action_view/layouts.rb index bf36dde181..b2fcd823d2 100644 --- a/actionview/lib/action_view/layouts.rb +++ b/actionview/lib/action_view/layouts.rb @@ -291,10 +291,10 @@ module ActionView end layout_definition = case _layout - when String - _layout.inspect - when Symbol - <<-RUBY + when String + _layout.inspect + when Symbol + <<-RUBY #{_layout}.tap do |layout| return #{default_behavior} if layout.nil? unless layout.is_a?(String) || !layout @@ -303,20 +303,20 @@ module ActionView end end RUBY - when Proc - define_method :_layout_from_proc, &_layout - protected :_layout_from_proc - <<-RUBY + when Proc + define_method :_layout_from_proc, &_layout + protected :_layout_from_proc + <<-RUBY result = _layout_from_proc(#{_layout.arity == 0 ? '' : 'self'}) return #{default_behavior} if result.nil? result RUBY - when false - nil - when true - raise ArgumentError, "Layouts must be specified as a String, Symbol, Proc, false, or nil" - when nil - name_clause + when false + nil + when true + raise ArgumentError, "Layouts must be specified as a String, Symbol, Proc, false, or nil" + when nil + name_clause end self.class_eval <<-RUBY, __FILE__, __LINE__ + 1 |