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.



248
249
250
251
# File 'lib/webrick/httpserver.rb', line 248

def initialize
  @tab = Hash.new
  compile
end

Instance Method Details

#[](dir) ⇒ Object



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

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

#[]=(dir, val) ⇒ Object



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

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

#delete(dir) ⇒ Object



265
266
267
268
269
270
# File 'lib/webrick/httpserver.rb', line 265

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

#scan(path) ⇒ Object



272
273
274
275
# File 'lib/webrick/httpserver.rb', line 272

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