Class: RIO::RRL::URIBase

Inherits:
WithPath show all
Defined in:
lib/rio/rrl/withpath.rb

Direct Known Subclasses

FTP::RRL, FTP::Stream::RRL, HTTP::RRL, PathBase

Instance Attribute Summary

Attributes inherited from Base

#fs, #uri

Class Method Summary collapse

Instance Method Summary collapse

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

#nodef

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

Instance Method Details

#initialize_copy(other) ⇒ Object



220
221
222
# File 'lib/rio/rrl/withpath.rb', line 220

def initialize_copy(other)
  super
end

#openfs_Object



223
224
225
226
# File 'lib/rio/rrl/withpath.rb', line 223

def openfs_()
  #p callstr('openfs_')
  self.fs || RIO::FS::LOCAL
end