Extract routing context to its own file.

This commit is contained in:
David Henry
2014-05-03 23:22:00 +01:00
parent feff27aaee
commit d875c01bc2
2 changed files with 12 additions and 8 deletions

View File

@@ -1,12 +1,4 @@
module Devise
class RoutingDetails
attr_reader :scope, :router_name
def initialize(mapping)
@scope = mapping.name
@router_name = mapping.router_name
end
end
# Responsible for handling devise mappings and routes configuration. Each
# resource configured by devise_for in routes is actually creating a mapping
# object. You can refer to devise_for in routes for usage options.

View File

@@ -0,0 +1,12 @@
module Devise
# This is a data transfer object to avoid coupling between
# Devive::Mapping and the rest of the application.
class RoutingDetails
attr_reader :scope, :router_name
def initialize(mapping)
@scope = mapping.name
@router_name = mapping.router_name
end
end
end