Class: RIO::Stream::Open

Inherits:
Base show all
Includes:
Cp::Open::Input, Cp::Open::Output, Ops::Path::URI, Ops::Stream::Status, Piper::Cp::Input
Defined in:
lib/rio/stream/open.rb,
lib/rio/stream/open.rb

Constant Summary

Constants inherited from RIO::State::Base

RIO::State::Base::KIOSYMS

Instance Attribute Summary

Attributes inherited from RIO::State::Base

#cx, #ioh, #rl, #try_state

Instance Method Summary collapse

Methods included from Piper::Cp::Input

#|

Methods included from Cp::Open::Input

#>, #>>

Methods included from Cp::Util::InOut

#cpclose, #cpclose0

Methods included from Cp::Open::Output

#<, #<<

Methods included from Ops::Path::URI

#abs, #abs?, #base, #merge, #rel, #route_from, #route_to, #setbase

Methods included from Ops::Stream::Status

#closed?, #eof?, #open?, #stat

Methods inherited from Base

#dir?, #recno, #stream?

Methods inherited from RIO::State::Base

#==, #===, #=~, #base_state, #became, #become, #callstr, #clone_rio, default_cx, #ensure_cmd_rio, #ensure_rio, #eql?, #error, #fs, #gofigure, #hash, #initialize, #initialize_copy, #method_missing, #method_missing_trace_str, new_other, #new_rio, #new_rio_cx, #reset, #retryreset, #softreset, #stream?, #to_rl, #to_uri, #to_url

Methods included from ZipFile::Cx

#zipfile

Methods included from RIO::Symantics

#rtn_new, #rtn_reset, #rtn_rio, #rtn_self, #rtn_val

Methods included from Ext::YAML::Cx

#documents, #objects, #skipdocuments, #skipobjects, #yaml, #yaml?, #yamldoc

Methods included from Ext::SplitLines::Cx

#columns, #columns?, #skipcolumns, #splitlines, #splitlines?

Methods included from Ext::CSV::Cx

#columns, #columns?, #csv, #csv?, #skipcolumns

Methods included from Cx::Methods

#+@, #_arg_skip, #_noarg_skip, #a, #a!, #all, #all?, #bytes, #bytes_, #closeoncopy, #closeoncopy?, #closeoneof, #closeoneof?, #copying, #copying?, #copying_done, #copying_from, #copying_from?, #copying_from_done, #copying_to, #copying_to?, #copying_to_done, #dir_iter?, #dirs, #entries, #ext, #ext?, #files, #gzip, #gzip?, #inputmode?, #line, #line_, #lines, #lines_, make_filter_methods, #mode, #mode?, #noall, #noautoclose, #nocloseoncopy, #nocloseoneof, #noext, #norecurse, #nostreamenum, #nostreamenum?, #nosync, #outputmode?, #r, #r!, #record, #record_, #records, #records_, #recurse, #row, #row_, #rows, #rows_, #skip, #skipdirs, #skipentries, #skipfiles, #skiplines, #skipping?, #skiprecords, #skiprecords_, #skiprows, #split, #stream_iter?, #sync, #sync?, #w, #w!

Constructor Details

This class inherits a constructor from RIO::State::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RIO::State::Base

Instance Method Details

#check?Boolean

Returns:

  • (Boolean)


55
# File 'lib/rio/stream/open.rb', line 55

def check?() true end

#iostate(sym) ⇒ Object

def size() self.contents.size end def empty?() self.eof? end



89
90
91
92
93
94
95
# File 'lib/rio/stream/open.rb', line 89

def iostate(sym)
  if mode? && mode?.allows_both?
    open_.inout()
  else
    implicit_state(sym)
  end
end

#open(m = nil, *args) ⇒ Object



57
58
59
60
61
62
63
64
# File 'lib/rio/stream/open.rb', line 57

def open(m=nil,*args)
  #p callstr('open',m,*args)
  case
  when open? then open_(*args)
  when m.nil? then open_(*args)
  else mode(m).open_(*args)
  end
end