Class: Rack::PathRecorder
- Inherits:
-
Object
- Object
- Rack::PathRecorder
- Defined in:
- lib/rack/headercontrol.rb
Instance Method Summary collapse
- #[](path) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ PathRecorder
constructor
A new instance of PathRecorder.
- #path(path, &block) ⇒ Object
Constructor Details
#initialize ⇒ PathRecorder
Returns a new instance of PathRecorder.
28 29 30 |
# File 'lib/rack/headercontrol.rb', line 28 def initialize @paths = {} end |
Instance Method Details
#[](path) ⇒ Object
36 37 38 |
# File 'lib/rack/headercontrol.rb', line 36 def [](path) @paths[path] end |
#each(&block) ⇒ Object
40 41 42 |
# File 'lib/rack/headercontrol.rb', line 40 def each(&block) @paths.each(&block) end |
#path(path, &block) ⇒ Object
32 33 34 |
# File 'lib/rack/headercontrol.rb', line 32 def path(path, &block) @paths[path] = block end |