Class: HttpRouter::Parts
- Inherits:
-
Array
- Object
- Array
- HttpRouter::Parts
- Defined in:
- lib/http_router/parts.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ Parts
constructor
A new instance of Parts.
- #replace(ary) ⇒ Object
- #shift ⇒ Object
- #whole_path ⇒ Object
Constructor Details
#initialize(path) ⇒ Parts
Returns a new instance of Parts.
3 4 5 |
# File 'lib/http_router/parts.rb', line 3 def initialize(path) super((path[0] == ?/ ? path[1, path.size] : path).split('/')) end |
Instance Method Details
#replace(ary) ⇒ Object
16 17 18 19 |
# File 'lib/http_router/parts.rb', line 16 def replace(ary) @whole_path = nil super end |
#shift ⇒ Object
11 12 13 14 |
# File 'lib/http_router/parts.rb', line 11 def shift @whole_path = nil super end |
#whole_path ⇒ Object
7 8 9 |
# File 'lib/http_router/parts.rb', line 7 def whole_path @whole_path ||= join('/') end |