Class: HttpRouter::Parts

Inherits:
Array
  • Object
show all
Defined in:
lib/http_router/parts.rb

Instance Method Summary collapse

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

#shiftObject



11
12
13
14
# File 'lib/http_router/parts.rb', line 11

def shift
  @whole_path = nil
  super
end

#whole_pathObject



7
8
9
# File 'lib/http_router/parts.rb', line 7

def whole_path
  @whole_path ||= join('/')
end