# File lib/ramaze/helper/layout.rb, line 89
        def set_layout(hash_or_layout)
          @_ramaze_layouts    ||= {}
          @_ramaze_old_layout ||= trait[:layout]

          # Extract the layout to use
          if hash_or_layout.respond_to?(:to_hash)
            # Invert the method/layout hash and save them so they don't get lost
            hash_or_layout.to_hash.each do |layout, layout_methods|
              layout_methods.each do |layout_method|
                @_ramaze_layouts[layout_method.to_s] = layout.to_s
              end
            end

            layout do |path, wish|
              path = path.to_s

              if @_ramaze_layouts.key?(path)
                use_layout = @_ramaze_layouts[path.to_s]
              # Use the old layout
              elsif @_ramaze_old_layout.respond_to?(:call)
                use_layout = @_ramaze_old_layout.call(path, wish)
              else
                use_layout = @_ramaze_old_layout
              end

              use_layout
            end
          else
            layout { |path| hash_or_layout }
          end
        end