Class: RIO::RRL::Base

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

Direct Known Subclasses

WithPath, Temp::RRL

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(u, fs = nil) ⇒ Base

Returns a new instance of Base.



36
37
38
39
# File 'lib/rio/rrl/base.rb', line 36

def initialize(u,fs=nil)
  @uri = u
  @fs ||= openfs_
end

Instance Attribute Details

#fsObject

Returns the value of attribute fs.



35
36
37
# File 'lib/rio/rrl/base.rb', line 35

def fs
  @fs
end

#uriObject

Returns the value of attribute uri.



35
36
37
# File 'lib/rio/rrl/base.rb', line 35

def uri
  @uri
end

Class Method Details

.parse(*a) ⇒ Object



45
46
47
48
# File 'lib/rio/rrl/base.rb', line 45

def self.parse(*a)
  u = a.shift.sub(/^rio:/,'')
  new(u,*a)
end

Instance Method Details

#==(other) ⇒ Object



54
# File 'lib/rio/rrl/base.rb', line 54

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

#===(other) ⇒ Object



55
# File 'lib/rio/rrl/base.rb', line 55

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

#=~(other) ⇒ Object



56
# File 'lib/rio/rrl/base.rb', line 56

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

#callstr(func, *args) ⇒ Object



64
65
66
# File 'lib/rio/rrl/base.rb', line 64

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

#closeObject



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

def close() 
  nil 
end

#initialize_copy(other) ⇒ Object



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

def initialize_copy(other)
  super
  @fs = other.fs if other.fs
  @uri = other.uri.clone if other.uri
end

#lengthObject



57
# File 'lib/rio/rrl/base.rb', line 57

def length() self.to_s.length end

#openfs_Object



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

def openfs_() 
  nil 
end

#to_sObject



53
# File 'lib/rio/rrl/base.rb', line 53

def to_s() uri.to_s end

#urlObject



58
# File 'lib/rio/rrl/base.rb', line 58

def url() uri.to_s end