Class: RIO::RRL::URIBase
- Defined in:
- lib/rio/rrl/withpath.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(u, *args) ⇒ URIBase
constructor
A new instance of URIBase.
- #initialize_copy(other) ⇒ Object
- #openfs_ ⇒ Object
Methods inherited from WithPath
#absolute?, #base, #base=, #fspath_no_slash, #host, #host=, #opaque, #path, #path=, #path_no_slash, #pathdepth, #pathroot, #scheme, #split
Methods included from Fwd
#fwd, #fwd_reader, #fwd_readers, #fwd_writer, #fwd_writers
Methods included from Error::NotImplemented
Methods inherited from Base
#==, #===, #=~, #callstr, #close, #length, #to_s, #url
Constructor Details
#initialize(u, *args) ⇒ URIBase
Returns a new instance of URIBase.
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/rio/rrl/withpath.rb', line 176 def initialize(u,*args) # u should be a ::URI or something that can be parsed to one #p callstr('initialize',u,*args) args,opts = _get_opts_from_args(args) uriref = case u when ::Alt::URI::Base _uriref_from_alturi(u,opts,*args) when ::RIO::URIRef if opts[:base] _uriref_from_alturi(u.ref,opts,*args) else rtn = u.clone.join(*args) rtn end else _uriref_from_alturi(::Alt::URI.parse(u.to_s,opts),opts,*args) end super(uriref,opts[:fs]) opts[:fs] ||= openfs_ self.uri.parts.encoding ||= opts[:fs].encoding end |
Class Method Details
.parse(*a) ⇒ Object
216 217 218 219 |
# File 'lib/rio/rrl/withpath.rb', line 216 def self.parse(*a) u = a.shift.sub(/^rio:/,'') new(u,*a) end |