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.



40
41
42
43
# File 'lib/rio/rl/base.rb', line 40

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

Instance Attribute Details

#fsObject

Returns the value of attribute fs.



39
40
41
# File 'lib/rio/rl/base.rb', line 39

def fs
  @fs
end

Class Method Details

.is_riorl?(s) ⇒ Boolean

Returns:

  • (Boolean)


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

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

.parse(*a) ⇒ Object



65
66
67
68
# File 'lib/rio/rl/base.rb', line 65

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

.split_riorl(s) ⇒ Object



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

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



50
51
52
# File 'lib/rio/rl/base.rb', line 50

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

Instance Method Details

#==(other) ⇒ Object



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

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

#===(other) ⇒ Object



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

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

#=~(other) ⇒ Object



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

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

#callstr(func, *args) ⇒ Object



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

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

#closeObject



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

def close() 
  nil 
end

#fspathObject



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

def fspath() nil end

#initialize_copy(cp) ⇒ Object



44
45
46
# File 'lib/rio/rl/base.rb', line 44

def initialize_copy(cp)
  super
end

#lengthObject



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

def length() self.to_s.length end

#openfs_Object



47
48
49
# File 'lib/rio/rl/base.rb', line 47

def openfs_() 
  nil 
end

#pathObject



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

def path() nil end

#rlObject



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

def rl() SCHC+self.url end

#to_rlObject



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

def to_rl() self.rl end

#to_sObject



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

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

#urlObject



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

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