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

:nodoc:



232
233
234
235
# File 'lib/webrick/httpserver.rb', line 232

def initialize
  @tab = Hash.new
  compile
end

Instance Method Details

#[](dir) ⇒ Object



237
238
239
240
# File 'lib/webrick/httpserver.rb', line 237

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

#[]=(dir, val) ⇒ Object



242
243
244
245
246
247
# File 'lib/webrick/httpserver.rb', line 242

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

#delete(dir) ⇒ Object



249
250
251
252
253
254
# File 'lib/webrick/httpserver.rb', line 249

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

#scan(path) ⇒ Object



256
257
258
259
# File 'lib/webrick/httpserver.rb', line 256

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