Class: Ixtlan::ChildPath
- Inherits:
-
Object
- Object
- Ixtlan::ChildPath
- Defined in:
- lib/ixtlan/child_path.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, rootpath) ⇒ ChildPath
constructor
A new instance of ChildPath.
Constructor Details
#initialize(app, rootpath) ⇒ ChildPath
Returns a new instance of ChildPath.
3 4 5 6 |
# File 'lib/ixtlan/child_path.rb', line 3 def initialize(app, rootpath) @app = app @rootpath = rootpath end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/ixtlan/child_path.rb', line 8 def call(env) ['REQUEST_PATH','PATH_INFO','REQUEST_URI','SCRIPT_NAME'].each do |key| if(env[key] =~ /[.]xml([?].*)?$/) env[key].gsub!(/^\/#{@rootpath}/, "") end end @app.call(env) end |