Class: Alt::URI::Base

Inherits:
Object show all
Extended by:
RIO::Fwd
Includes:
Ops::PathParts
Defined in:
lib/rio/alturi.rb

Direct Known Subclasses

FTP, File, Generic, HTTP

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RIO::Fwd

fwd, fwd_reader, fwd_readers, fwd_writer, fwd_writers

Methods included from Ops::PathParts

#basename, #basename=, #dirname, #dirname=, #extname, #extname=, #filename, #filename=, #netpath

Constructor Details

#initialize(parts) ⇒ Base

Returns a new instance of Base.



133
134
135
136
# File 'lib/rio/alturi.rb', line 133

def initialize(parts)
  @parts = parts
  @ext = nil
end

Instance Attribute Details

#extObject

Returns the value of attribute ext.



132
133
134
# File 'lib/rio/alturi.rb', line 132

def ext
  @ext
end

#partsObject (readonly)

Returns the value of attribute parts.



131
132
133
# File 'lib/rio/alturi.rb', line 131

def parts
  @parts
end

Instance Method Details

#==(other) ⇒ Object



142
143
144
# File 'lib/rio/alturi.rb', line 142

def ==(other) 
  @parts == other.parts 
end

#initialize_copy(other) ⇒ Object



137
138
139
140
141
# File 'lib/rio/alturi.rb', line 137

def initialize_copy(other)
  @ext = other.ext
  super
  @parts = other.parts.dup
end

#lengthObject



148
149
150
# File 'lib/rio/alturi.rb', line 148

def length
  self.to_s.length
end

#normalizeObject



145
146
147
# File 'lib/rio/alturi.rb', line 145

def normalize
  self
end

#sub(re, arg) ⇒ Object



151
152
153
154
155
# File 'lib/rio/alturi.rb', line 151

def sub(re,arg)
  cp = self.clone
  cp.path = cp.path.sub(re,arg)
  cp
end