Module: RIO::Ops::Path::URI
Instance Method Summary
collapse
Methods included from Fwd
fwd, fwd_reader, fwd_readers, fwd_writer, fwd_writers
Instance Method Details
#abs(base = nil) ⇒ Object
82
83
84
85
86
87
88
89
90
|
# File 'lib/rio/ops/path.rb', line 82
def abs(base=nil)
if base.nil?
nrio = new_rio(rl.abs)
nrio
else
brio = ensure_rio(base)
new_rio(rl.abs(ensure_rio(base).to_s))
end
end
|
#absolute? ⇒ Boolean
Also known as:
abs?
91
92
93
|
# File 'lib/rio/ops/path.rb', line 91
def absolute?
rl.absolute?
end
|
116
117
118
|
# File 'lib/rio/ops/path.rb', line 116
def base()
new_rio(rl.base())
end
|
#merge(other) ⇒ Object
113
114
115
|
# File 'lib/rio/ops/path.rb', line 113
def merge(other)
new_rio(rl.merge(ensure_rio(other).rl))
end
|
#rel(other = nil) ⇒ Object
100
101
102
103
104
105
106
107
108
109
|
# File 'lib/rio/ops/path.rb', line 100
def rel(other=nil)
if other.nil?
base = self.abs.dirname
else
new_rio(self.rl.abs.route_from(ensure_rio(other).rl.abs))
end
base = other.nil? ? self.abs : ensure_rio(other).dup
base += '/' if base.directory? and base.to_s[-1] != '/'
route_from(base)
end
|
#route_from(other) ⇒ Object
95
96
97
98
99
|
# File 'lib/rio/ops/path.rb', line 95
def route_from(other)
this_uri = rl.uri.abs
other_uri = ensure_rio(other).rl.uri.abs
new_rio(this_uri.route_from(other_uri))
end
|
#route_to(other) ⇒ Object
110
111
112
|
# File 'lib/rio/ops/path.rb', line 110
def route_to(other)
new_rio(rl.abs.route_to(ensure_rio(other).rl.abs))
end
|
#setbase(b) ⇒ Object
119
120
121
122
|
# File 'lib/rio/ops/path.rb', line 119
def setbase(b)
rl.base(b)
self
end
|