Class: WEBrick::HTTPServer::MountTable

Inherits:
Object
  • Object
show all
Defined in:
lib/webrick/httpserver.rb

Overview

Mount table for the path a servlet is mounted on in the directory space of the server. Users of WEBrick can only access this indirectly via WEBrick::HTTPServer#mount, WEBrick::HTTPServer#unmount and WEBrick::HTTPServer#search_servlet

Instance Method Summary collapse

Constructor Details

#initializeMountTable

Returns a new instance of MountTable.



234
235
236
237
# File 'lib/webrick/httpserver.rb', line 234

def initialize
  @tab = Hash.new
  compile
end

Instance Method Details

#[](dir) ⇒ Object



239
240
241
242
# File 'lib/webrick/httpserver.rb', line 239

def [](dir)
  dir = normalize(dir)
  @tab[dir]
end

#[]=(dir, val) ⇒ Object



244
245
246
247
248
249
# File 'lib/webrick/httpserver.rb', line 244

def []=(dir, val)
  dir = normalize(dir)
  @tab[dir] = val
  compile
  val
end

#delete(dir) ⇒ Object



251
252
253
254
255
256
# File 'lib/webrick/httpserver.rb', line 251

def delete(dir)
  dir = normalize(dir)
  res = @tab.delete(dir)
  compile
  res
end

#scan(path) ⇒ Object



258
259
260
261
# File 'lib/webrick/httpserver.rb', line 258

def scan(path)
  @scanner =~ path
  [ $&, $' ]
end