The module that serves as a namespace for all Arrow classes.
Define an exception class with the specified name (a Symbol) with the specified message. The new exception class will inherit from the specified superclass, if specified, or StandardError if not specified.
# File lib/arrow/exceptions.rb, line 41
41: def Arrow.def_exception( name, message, superclass=Arrow::Exception )
42: name = name.id2name if name.kind_of?( Fixnum )
43: eClass = Class.new( superclass )
44: eClass.module_eval %Q{
45: def initialize( *args )
46: if ! args.empty?
47: msg = args.collect {|a| a.to_s}.join
48: super( msg )
49: else
50: super( message )
51: end
52: end
53: }
54:
55: const_set( name, eClass )
56: end
--- SEC00015
--- ""
--- | Module <a href="Arrow/Config.html" class="link">Arrow::Config</a><br /> Module <a href="Arrow/Configurable.html" class="link">Arrow::Configurable</a><br /> Module <a href="Arrow/HTMLUtilities.html" class="link">Arrow::HTMLUtilities</a><br /> Module <a href="Arrow/Injectable.html" class="link">Arrow::Injectable</a><br /> Module <a href="Arrow/Loggable.html" class="link">Arrow::Loggable</a><br /> Module <a href="Arrow/Logger.html" class="link">Arrow::Logger</a><br /> Module <a href="Arrow/Session.html" class="link">Arrow::Session</a><br /> Module <a href="Arrow/Template.html" class="link">Arrow::Template</a><br /> Class <a href="Arrow/Applet.html" class="link">Arrow::Applet</a><br /> Class <a href="Arrow/AppletRegistry.html" class="link">Arrow::AppletRegistry</a><br /> Class <a href="Arrow/AppletTestCase.html" class="link">Arrow::AppletTestCase</a><br /> Class <a href="Arrow/Broker.html" class="link">Arrow::Broker</a><br /> Class <a href="Arrow/Cache.html" class="link">Arrow::Cache</a><br /> Class <a href="Arrow/Config.html" class="link">Arrow::Config</a><br /> Class <a href="Arrow/Cookie.html" class="link">Arrow::Cookie</a><br /> Class <a href="Arrow/CookieSet.html" class="link">Arrow::CookieSet</a><br /> Class <a href="Arrow/DataSource.html" class="link">Arrow::DataSource</a><br /> Class <a href="Arrow/Dispatcher.html" class="link">Arrow::Dispatcher</a><br /> Class <a href="Arrow/DispatcherLoader.html" class="link">Arrow::DispatcherLoader</a><br /> Class <a href="Arrow/Exception.html" class="link">Arrow::Exception</a><br /> Class <a href="Arrow/FallbackHandler.html" class="link">Arrow::FallbackHandler</a><br /> Class <a href="Arrow/FormValidator.html" class="link">Arrow::FormValidator</a><br /> Class <a href="Arrow/HTMLTokenizer.html" class="link">Arrow::HTMLTokenizer</a><br /> Class <a href="Arrow/Logger.html" class="link">Arrow::Logger</a><br /> Class <a href="Arrow/Monitor.html" class="link">Arrow::Monitor</a><br /> Class <a href="Arrow/Object.html" class="link">Arrow::Object</a><br /> Class <a href="Arrow/Response.html" class="link">Arrow::Response</a><br /> Class <a href="Arrow/RubyTokenReactor.html" class="link">Arrow::RubyTokenReactor</a><br /> Class <a href="Arrow/Session.html" class="link">Arrow::Session</a><br /> Class <a href="Arrow/Subject.html" class="link">Arrow::Subject</a><br /> Class <a href="Arrow/Template.html" class="link">Arrow::Template</a><br /> Class <a href="Arrow/TemplateFactory.html" class="link">Arrow::TemplateFactory</a><br /> Class <a href="Arrow/TestCase.html" class="link">Arrow::TestCase</a><br /> Class <a href="Arrow/TestDataSource.html" class="link">Arrow::TestDataSource</a><br /> Class <a href="Arrow/Transaction.html" class="link">Arrow::Transaction</a><br />
---
- methods:
- visibility: public
aref: M000035
name: def_exception
sourcecode: " <span class=\"ruby-comment cmt\"># File lib/arrow/exceptions.rb, line 41</span>\n\
41: <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-constant\">Arrow</span>.<span class=\"ruby-identifier\">def_exception</span>( <span class=\"ruby-identifier\">name</span>, <span class=\"ruby-identifier\">message</span>, <span class=\"ruby-identifier\">superclass</span>=<span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Exception</span> )\n\
42: <span class=\"ruby-identifier\">name</span> = <span class=\"ruby-identifier\">name</span>.<span class=\"ruby-identifier\">id2name</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">name</span>.<span class=\"ruby-identifier\">kind_of?</span>( <span class=\"ruby-constant\">Fixnum</span> )\n\
43: <span class=\"ruby-identifier\">eClass</span> = <span class=\"ruby-constant\">Class</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">superclass</span> )\n\
44: <span class=\"ruby-identifier\">eClass</span>.<span class=\"ruby-identifier\">module_eval</span> <span class=\"ruby-value str\">%Q{\n\
45: def initialize( *args )\n\
46: if ! args.empty?\n\
47: msg = args.collect {|a| a.to_s}.join\n\
48: super( msg )\n\
49: else\n\
50: super( message )\n\
51: end \n\
52: end\n\
53: }</span>\n\
54: \n\
55: <span class=\"ruby-identifier\">const_set</span>( <span class=\"ruby-identifier\">name</span>, <span class=\"ruby-identifier\">eClass</span> )\n\
56: <span class=\"ruby-keyword kw\">end</span>"
m_desc: |-
<p>
Define an exception class with the specified <tt>name</tt> (a Symbol) with
the specified <tt>message</tt>. The new exception class will inherit from
the specified <tt>superclass</tt>, if specified, or <tt>StandardError</tt>
if not specified.
</p>
params: ( name, message, superclass=Arrow::Exception )
category: Class
type: Public
---
---
- name: HashMergeFunction
desc: |+
Recursive hash-merge function
value: "Proc.new {|key, oldval, newval| #debugMsg "Merging '%s': %s -> %s" % # [ key.inspect, oldval.inspect, newval.inspect ] case oldval"
- name: SVNRev
desc: |+
SVN Revision
value: "%q$Rev: 432 $"
- name: SVNId
desc: |+
SVN Id
value: "%q$Id: arrow.rb 432 2008-02-20 19:26:10Z deveiant $"
- name: VERSION
desc: |+
Release version
value: "'0.9.3'"
- name: HOSTS_CONFIG_LINE
value: "<<-EOF Can't load Arrow: No host config specified. Try setting the 'hosts_map' option via a line like: RubyOption hosts_map "/path/to/yaml/hosts/file.yml" EOF"
- name: YamlDomain
desc: |+
Yaml stuff
value: ""rubycrafters.com,2003-10-22""
Generated with the Darkfish Rdoc Generator.