Class: Sinatra::URL::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra/url.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMapper

Returns a new instance of Mapper.



17
18
19
# File 'lib/sinatra/url.rb', line 17

def initialize
  @map = {}
end

Class Method Details

.defaultObject



13
14
15
# File 'lib/sinatra/url.rb', line 13

def self.default
  @default ||= new
end

Instance Method Details

#[](name) ⇒ Object



21
22
23
# File 'lib/sinatra/url.rb', line 21

def [](name)
  @map[name]
end

#[]=(name, path) ⇒ Object



25
26
27
# File 'lib/sinatra/url.rb', line 25

def []=(name, path)
  @map[name] = Route.new(path)
end