Class: RIO::State::Error

Inherits:
Base show all
Defined in:
lib/rio/state/error.rb

Constant Summary

Constants inherited from Base

Base::KIOSYMS

Instance Attribute Summary collapse

Attributes inherited from Base

#cx, #ioh, #rl, #try_state

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, #===, #=~, #base_state, #became, #become, #callstr, #clone_rio, default_cx, #ensure_cmd_rio, #ensure_rio, #eql?, #error, #fs, #gofigure, #hash, #initialize_copy, #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

#initializeError

Returns a new instance of Error.



43
44
45
46
47
48
49
# File 'lib/rio/state/error.rb', line 43

def initialize
  super
  @obj = nil
  @msg = nil
  @sym = nil
#        self.send(sym,*args) #unless obj == self
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object

Raises:



52
53
54
55
56
57
# File 'lib/rio/state/error.rb', line 52

def method_missing(sym,*args,&block)
 #       emsg = sprintf("Can't Handle %s[%s].%s(%s)",@obj.class.to_s,@obj.to_s,sym.to_s,args.join(','))
 #       emsg += "\n  "+@msg unless @msg.nil? or @msg.empty?
  emsg = @msg
  raise Exception::CantHandle.new(@obj,sym,*args),emsg
end

Instance Attribute Details

#msgObject

Returns the value of attribute msg.



42
43
44
# File 'lib/rio/state/error.rb', line 42

def msg
  @msg
end

#objObject

Returns the value of attribute obj.



42
43
44
# File 'lib/rio/state/error.rb', line 42

def obj
  @obj
end

#symObject

Returns the value of attribute sym.



42
43
44
# File 'lib/rio/state/error.rb', line 42

def sym
  @sym
end

Class Method Details

.error(emsg, obj, sym, *args) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/rio/state/error.rb', line 58

def self.error(emsg,obj,sym,*args)
  require 'rio/exception'
  state = new
  state.obj = obj
  state.sym = sym
  msg = sprintf("%s[%s].%s(%s)",obj.class.to_s,obj.to_s,sym.to_s,args.join(','))
  msg += "\n  "+emsg unless emsg.nil? or emsg.empty?
  state.msg = msg
  state
#        raise CantHandle.new(obj,sym,*args),emsg
end

Instance Method Details

#check?Boolean

self.send(sym,*args) #unless obj == self

Returns:

  • (Boolean)


50
# File 'lib/rio/state/error.rb', line 50

def check?() true end

#when_missing(sym, *args) ⇒ Object



51
# File 'lib/rio/state/error.rb', line 51

def when_missing(sym,*args) self end