Method: URI::Generic#route_from
- Defined in:
- lib/extensions/uri/uri/generic.rb
#route_from(oth) ⇒ Object Also known as: -
924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 |
# File 'lib/extensions/uri/uri/generic.rb', line 924 def route_from(oth) # you can modify `rel', but can not `oth'. begin oth, rel = route_from0(oth) rescue raise $!.class, $!. end if oth == rel return rel end rel.set_path(route_from_path(oth.path, self.path)) if rel.path == './' && self.query # "./?foo" -> "?foo" rel.set_path('') end return rel end |