Module: Arrow
- Defined in:
- lib/arrow.rb,
lib/arrow/mixins.rb,
lib/arrow/constants.rb,
lib/arrow/exceptions.rb,
lib/arrow/appletmixins.rb,
lib/arrow/htmltokenizer.rb
Overview
:nodoc:
Defined Under Namespace
Modules: AccessControls, AppletAuthentication, ArrayUtilities, Constants, HTMLUtilities, HashUtilities, HtmlInspectableObject, Injectable, Loggable, RegexpOperators, SpecHelpers, StringExtensions Classes: AcceptParam, Applet, AppletRegistry, AppletTestCase, Broker, Cache, Config, Cookie, CookieSet, Dispatcher, DispatcherLoader, DocType, Exception, FallbackHandler, FormValidator, HTMLComment, HTMLTag, HTMLText, HTMLToken, HTMLTokenizer, Logger, Object, Path, ProcessingInstruction, Service, Session, Template, TemplateFactory, TestCase, Transaction
Constant Summary collapse
- VERSION =
Library version
'1.0.8'- REVISION =
VCS revision
%q$Revision: 41058a07b224 $
Class Method Summary collapse
-
.def_exception(name, message, superclass = Arrow::Exception) ⇒ Object
Define an exception class with the specified
name(a Symbol) with the specifiedmessage. -
.version_string(include_buildnum = false) ⇒ Object
Return the library’s version string.
Class Method Details
.def_exception(name, message, superclass = Arrow::Exception) ⇒ Object
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.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/arrow/exceptions.rb', line 18 def Arrow.def_exception( name, , superclass=Arrow::Exception ) name = name.id2name if name.kind_of?( Fixnum ) eClass = Class.new( superclass ) eClass.module_eval %Q{ def initialize( *args ) if ! args.empty? msg = args.collect {|a| a.to_s}.join super( msg ) else super( message ) end end } const_set( name, eClass ) end |
.version_string(include_buildnum = false) ⇒ Object
Return the library’s version string
45 46 47 48 49 |
# File 'lib/arrow.rb', line 45 def self::version_string( include_buildnum=false ) vstring = "%s %s" % [ self.name, VERSION ] vstring << " (build %s)" % [ REVISION[/: ([[:xdigit:]]+)/, 1] || '0' ] if include_buildnum return vstring end |