diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -1901,7 +1901,7 @@ module ActionDispatch
 
         RESOURCE_SCOPES = [:resource, :resources]
 
-        attr_reader :parent
+        attr_reader :parent, :scope_level
 
         def initialize(hash, parent = {}, scope_level = nil)
           @hash = hash
@@ -1909,10 +1909,6 @@ module ActionDispatch
           @scope_level = scope_level
         end
 
-        def scope_level
-          @scope_level
-        end
-
         def nested?
           scope_level == :nested
         end
change to attr_reader