Class: RIO::FD::RRL

Inherits:
RRL::SysIOBase
  • Object
show all
Defined in:
lib/rio/scheme/fd.rb

Constant Summary collapse

RIOSCHEME =
'fd'
RIOPATH =
RIO::RRL::CHMAP.invert[RIOSCHEME].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(u, *args) ⇒ RRL

Returns a new instance of RRL.



35
36
37
38
# File 'lib/rio/scheme/fd.rb', line 35

def initialize(u,*args)
  super(::Alt::URI.parse(u.to_s))
  self.query ||= args.shift
end

Instance Attribute Details

#fdObject (readonly)

Returns the value of attribute fd.



34
35
36
# File 'lib/rio/scheme/fd.rb', line 34

def fd
  @fd
end

Instance Method Details

#open(m, *args) ⇒ Object



46
47
48
# File 'lib/rio/scheme/fd.rb', line 46

def open(m,*args)
  super(::IO.new(self.query,m.to_s))
end

#queryObject



43
44
45
# File 'lib/rio/scheme/fd.rb', line 43

def query
  uri.query.nil? ? nil :  uri.query.to_i
end

#query=(arg) ⇒ Object



39
40
41
42
# File 'lib/rio/scheme/fd.rb', line 39

def query=(arg)
  uri.query = arg.nil? ? nil : arg.to_s
  arg
end