Class: RIO::RL::Base

Inherits:
Object show all
Defined in:
lib/rio/rl/base.rb

Direct Known Subclasses

WithPath, ZipFile::RootDir::RL

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Base

Returns a new instance of Base.



53
54
55
56
# File 'lib/rio/rl/base.rb', line 53

def initialize(*args)
  #p callstr('Base#initialize',*args)
  @fs = openfs_
end

Instance Attribute Details

#fsObject

Returns the value of attribute fs.



52
53
54
# File 'lib/rio/rl/base.rb', line 52

def fs
  @fs
end

Class Method Details

.is_riorl?(s) ⇒ Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/rio/rl/base.rb', line 74

def self.is_riorl?(s)
  s[0...SCHC.length] == SCHC
end

.parse(*a) ⇒ Object



78
79
80
81
# File 'lib/rio/rl/base.rb', line 78

def self.parse(*a)
  parms = splitrl(a.shift) || []
  new(*(parms+a))
end

.split_riorl(s) ⇒ Object



67
68
69
70
71
72
# File 'lib/rio/rl/base.rb', line 67

def self.split_riorl(s)
  body = s[SCHC.length...s.length]
  m = SPLIT_RIORL_RE.match(body) 
  return [] if m.nil?
  return m[1],m[3],m[0]
end

.subscheme(s) ⇒ Object



63
64
65
# File 'lib/rio/rl/base.rb', line 63

def self.subscheme(s)
  /^rio:([^:]+):/.match(s)[1]
end

Instance Method Details

#==(other) ⇒ Object



88
# File 'lib/rio/rl/base.rb', line 88

def ==(other) self.to_s == other.to_s end

#===(other) ⇒ Object



89
# File 'lib/rio/rl/base.rb', line 89

def ===(other) self == other end

#=~(other) ⇒ Object



90
# File 'lib/rio/rl/base.rb', line 90

def =~(other) other =~ self.to_str end

#callstr(func, *args) ⇒ Object



113
114
115
# File 'lib/rio/rl/base.rb', line 113

def callstr(func,*args)
  self.class.to_s+'['+self.to_s+']'+'.'+func.to_s+'('+args.join(',')+')'
end

#closeObject



99
100
101
102
# File 'lib/rio/rl/base.rb', line 99

def close() 
  #p "Closing RL #{self}"
  nil 
end

#escape(pth, esc = RL::ESCAPE) ⇒ Object



106
107
108
# File 'lib/rio/rl/base.rb', line 106

def escape(pth,esc=RL::ESCAPE)
  RL.escape(pth,esc)
end

#fs2url(pth) ⇒ Object



104
# File 'lib/rio/rl/base.rb', line 104

def fs2url(pth) RL.fs2url(pth) end

#fspathObject



93
# File 'lib/rio/rl/base.rb', line 93

def fspath() nil end

#initialize_copy(cp) ⇒ Object



57
58
59
# File 'lib/rio/rl/base.rb', line 57

def initialize_copy(cp)
  super
end

#lengthObject



91
# File 'lib/rio/rl/base.rb', line 91

def length() self.to_s.length end

#openfs_Object



60
61
62
# File 'lib/rio/rl/base.rb', line 60

def openfs_() 
  nil 
end

#pathObject



94
# File 'lib/rio/rl/base.rb', line 94

def path() nil end

#rlObject



83
# File 'lib/rio/rl/base.rb', line 83

def rl() SCHC+self.url end

#to_rlObject



96
# File 'lib/rio/rl/base.rb', line 96

def to_rl() self.rl end

#to_sObject

def riorl() SCHC+self.url end



87
# File 'lib/rio/rl/base.rb', line 87

def to_s() self.fspath || '' end

#unescape(pth) ⇒ Object



109
110
111
# File 'lib/rio/rl/base.rb', line 109

def unescape(pth)
  RL.unescape(pth)
end

#urlObject



98
# File 'lib/rio/rl/base.rb', line 98

def url() self.scheme+SUBSEPAR+self.opaque end

#url2fs(pth) ⇒ Object



105
# File 'lib/rio/rl/base.rb', line 105

def url2fs(pth) RL.url2fs(pth) end