Subversion Info

Rev
424
Last Checked In
2007-08-20 20:54:26 (6 months ago)
Checked in by
phaedrus

Parent

Class Index

Quicksearch

Arrow::Config

Instances of this class contain configuration values for for an Arrow web application.

Constants

SVNRev
SVN Revision
SVNId
SVN Id
DEFAULTS
Define the layout and defaults for the underlying structs

Attributes

create_time[RW]
The time the configuration was loaded
default_loader[RW]

(Not documented)

loader[R]
The loader that will be used to save this config
loaders[RW]

(Not documented)

name[RW]
The name of the associated record stored on permanent storage for this configuration.

Public Class Methods

get_loader( name=nil ) click to toggle source

Get the loader by the given name, creating a new one if one is not already instantiated.

     # File lib/arrow/config.rb, line 183
183:     def self::get_loader( name=nil )
184:         name ||= self.default_loader
185:         self.loaders[name] ||= Arrow::Config::Loader.create( name )
186:     end
load( source, loader_obj=nil ) click to toggle source

Read and return an Arrow::Config object from the given file or configuration source using the specified loader.

     # File lib/arrow/config.rb, line 191
191:     def self::load( source, loader_obj=nil )
192:         loader_obj = self.get_loader( loader_obj ) unless
193:             loader_obj.is_a?( Arrow::Config::Loader )
194:         my_source = source.dup
195:         my_source.untaint
196:         confighash = loader_obj.load( my_source )
197: 
198:         obj = new( confighash )
199:         obj.loader = loader_obj
200:         obj.name = my_source
201: 
202:         return obj
203:     end
new( confighash={} ) click to toggle source

Create a new Arrow::Config object. Values passed in via the confighash will be used instead of the defaults.

     # File lib/arrow/config.rb, line 212
212:     def initialize( confighash={} )
213:         ihash = internify_keys( untaint_values(confighash) )
214:         mergedhash = DEFAULTS.merge( ihash, &Arrow::HashMergeFunction )
215: 
216:         @struct      = ConfigStruct.new( mergedhash )
217:         @create_time = Time.now
218:         @name        = nil
219:         @loader      = self.class.get_loader
220: 
221:         super()
222:     end

Public Instance Methods

changed?() click to toggle source

Returns true if the configuration has changed since it was last loaded, either by setting one of its members or changing the file from which it was loaded.

     # File lib/arrow/config.rb, line 280
280:     def changed?
281:         return self.changed_reason ? true : false
282:     end
changed_reason() click to toggle source

If the configuration has changed, return the reason. If it hasn‘t, returns nil.

     # File lib/arrow/config.rb, line 287
287:     def changed_reason
288:         return "Struct was modified" if @struct.modified?
289:         
290:         if self.name && self.loader.is_newer?( self.name, self.create_time )
291:             return "Config source (%s) has been updated since %s" %
292:                 [ self.name, self.create_time ]
293:         end
294: 
295:         return nil
296:     end
loader=( new_loader ) click to toggle source

Change the configuration object‘s loader. The new_loader argument can be either an Arrow::Config::Loader object or the name of one suitable for passing to Arrow::Config::Loader.create.

     # File lib/arrow/config.rb, line 250
250:     def loader=( new_loader )
251:         if new_loader.is_a?( Arrow::Config::Loader )
252:             @loader = new_loader
253:         else
254:             @loader = self.class.get_loader( new_loader )
255:         end
256:     end
reload() click to toggle source

Reload the configuration from the original source if it has changed. Returns true if it was reloaded and false otherwise.

     # File lib/arrow/config.rb, line 301
301:     def reload
302:         return false unless @loader && @name
303:         
304:         # Even if reloading fails, reset the creation time so we don't keep
305:         # trying to reload a broken config
306:         self.create_time = Time.now
307: 
308:         confighash = @loader.load( @name )
309:         ihash = internify_keys( untaint_values(confighash) )
310:         mergedhash = DEFAULTS.merge( ihash, &Arrow::HashMergeFunction )
311:         
312:         @struct = ConfigStruct.new( mergedhash )
313: 
314:     rescue => err
315:         self.log.error "Error while trying to reload the config: %s" % err.message
316:         err.backtrace.each {|frame| self.log.debug "  " + frame }
317:         
318:         return false
319:     else
320:         return true
321:     end
respond_to?( sym ) click to toggle source

Returns true for methods which can be autoloaded

     # File lib/arrow/config.rb, line 271
271:     def respond_to?( sym )
272:         return true if @struct.member?( sym.to_s.sub(/(=|\?)$/, '').intern )
273:         super
274:     end
write( name=@name, *args ) click to toggle source

Write the configuration object using the specified name and any additional args.

     # File lib/arrow/config.rb, line 261
261:     def write( name=@name, *args )
262:         raise ArgumentError,
263:             "No name associated with this config." unless name
264:         lobj = self.loader
265:         strHash = stringify_keys( @struct.to_h )
266:         self.loader.save( strHash, name, *args )
267:     end

Protected Instance Methods

method_missing( sym, *args ) click to toggle source

Hook up delegators to struct-members as they are called

     # File lib/arrow/config.rb, line 329
329:     def method_missing( sym, *args )
330:         key = sym.to_s.sub( /(=|\?)$/, '' ).intern
331:         return nil unless @struct.member?( key )
332: 
333:         self.log.debug( "Autoloading #{key} accessors." )
334: 
335:         self.class.class_eval %{
336:             def #{key}; @struct.#{key}; end
337:             def #{key}=(*args); @struct.#{key} = *args; end
338:             def #{key}?; @struct.#{key}?; end
339:         }
340: 
341:         @struct.__send__( sym, *args )
342:     end

secsequence

--- SEC00032

seccomment

--- ""

classlist

--- |
Class <a href="Config/ConfigStruct.html" class="link">Arrow::Config::ConfigStruct</a><br />
Class <a href="Config/Loader.html" class="link">Arrow::Config::Loader</a><br />

attributes

--- 
- name: create_time
  rw: RW
  a_desc: |+
    
    The time the configuration was loaded
    
- name: default_loader
  rw: RW
  a_desc: ""
- name: loader
  rw: R
  a_desc: |+
    
    The loader that will be used to save this config
    
- name: loaders
  rw: RW
  a_desc: ""
- name: name
  rw: RW
  a_desc: |+
    
    The name of the associated record stored on permanent storage for this
    configuration.
    

method_list

--- 
- methods: 
  - visibility: public
    aref: M000271
    name: get_loader
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/arrow/config.rb, line 183</span>\n\
      183:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-keyword kw\">self</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">get_loader</span>( <span class=\"ruby-identifier\">name</span>=<span class=\"ruby-keyword kw\">nil</span> )\n\
      184:         <span class=\"ruby-identifier\">name</span> <span class=\"ruby-operator\">||=</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">default_loader</span>\n\
      185:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">loaders</span>[<span class=\"ruby-identifier\">name</span>] <span class=\"ruby-operator\">||=</span> <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Config</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Loader</span>.<span class=\"ruby-identifier\">create</span>( <span class=\"ruby-identifier\">name</span> )\n\
      186:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Get the loader by the given name, creating a <a
      href="Config.html#M000273">new</a> one if one is not already instantiated.
      </p>
    params: ( name=nil )
  - visibility: public
    aref: M000272
    name: load
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/arrow/config.rb, line 191</span>\n\
      191:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-keyword kw\">self</span><span class=\"ruby-operator\">::</span><span class=\"ruby-identifier\">load</span>( <span class=\"ruby-identifier\">source</span>, <span class=\"ruby-identifier\">loader_obj</span>=<span class=\"ruby-keyword kw\">nil</span> )\n\
      192:         <span class=\"ruby-identifier\">loader_obj</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">get_loader</span>( <span class=\"ruby-identifier\">loader_obj</span> ) <span class=\"ruby-keyword kw\">unless</span>\n\
      193:             <span class=\"ruby-identifier\">loader_obj</span>.<span class=\"ruby-identifier\">is_a?</span>( <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Config</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Loader</span> )\n\
      194:         <span class=\"ruby-identifier\">my_source</span> = <span class=\"ruby-identifier\">source</span>.<span class=\"ruby-identifier\">dup</span>\n\
      195:         <span class=\"ruby-identifier\">my_source</span>.<span class=\"ruby-identifier\">untaint</span>\n\
      196:         <span class=\"ruby-identifier\">confighash</span> = <span class=\"ruby-identifier\">loader_obj</span>.<span class=\"ruby-identifier\">load</span>( <span class=\"ruby-identifier\">my_source</span> )\n\
      197: \n\
      198:         <span class=\"ruby-identifier\">obj</span> = <span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">confighash</span> )\n\
      199:         <span class=\"ruby-identifier\">obj</span>.<span class=\"ruby-identifier\">loader</span> = <span class=\"ruby-identifier\">loader_obj</span>\n\
      200:         <span class=\"ruby-identifier\">obj</span>.<span class=\"ruby-identifier\">name</span> = <span class=\"ruby-identifier\">my_source</span>\n\
      201: \n\
      202:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">obj</span>\n\
      203:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Read and return an <a href="Config.html">Arrow::Config</a> object from the
      given file or configuration source using the specified <tt>loader</tt>.
      </p>
    params: ( source, loader_obj=nil )
  - visibility: public
    aref: M000273
    name: new
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/arrow/config.rb, line 212</span>\n\
      212:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">initialize</span>( <span class=\"ruby-identifier\">confighash</span>={} )\n\
      213:         <span class=\"ruby-identifier\">ihash</span> = <span class=\"ruby-identifier\">internify_keys</span>( <span class=\"ruby-identifier\">untaint_values</span>(<span class=\"ruby-identifier\">confighash</span>) )\n\
      214:         <span class=\"ruby-identifier\">mergedhash</span> = <span class=\"ruby-constant\">DEFAULTS</span>.<span class=\"ruby-identifier\">merge</span>( <span class=\"ruby-identifier\">ihash</span>, <span class=\"ruby-operator\">&amp;</span><span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">HashMergeFunction</span> )\n\
      215: \n\
      216:         <span class=\"ruby-ivar\">@struct</span>      = <span class=\"ruby-constant\">ConfigStruct</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">mergedhash</span> )\n\
      217:         <span class=\"ruby-ivar\">@create_time</span> = <span class=\"ruby-constant\">Time</span>.<span class=\"ruby-identifier\">now</span>\n\
      218:         <span class=\"ruby-ivar\">@name</span>        = <span class=\"ruby-keyword kw\">nil</span>\n\
      219:         <span class=\"ruby-ivar\">@loader</span>      = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">get_loader</span>\n\
      220: \n\
      221:         <span class=\"ruby-keyword kw\">super</span>()\n\
      222:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Create a <a href="Config.html#M000273">new</a> <a
      href="Config.html">Arrow::Config</a> object. Values passed in via the
      <tt>confighash</tt> will be used instead of the defaults.
      </p>
    params: ( confighash={} )
  category: Class
  type: Public
- methods: 
  - visibility: public
    aref: M000277
    name: changed?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/arrow/config.rb, line 280</span>\n\
      280:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">changed?</span>\n\
      281:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">changed_reason</span> <span class=\"ruby-value\">? </span><span class=\"ruby-keyword kw\">true</span> <span class=\"ruby-operator\">:</span> <span class=\"ruby-keyword kw\">false</span>\n\
      282:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Returns <tt>true</tt> if the configuration has changed since it was last
      loaded, either by setting one of its members or changing the file from
      which it was loaded.
      </p>
    params: ()
  - visibility: public
    aref: M000278
    name: changed_reason
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/arrow/config.rb, line 287</span>\n\
      287:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">changed_reason</span>\n\
      288:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-value str\">&quot;Struct was modified&quot;</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-ivar\">@struct</span>.<span class=\"ruby-identifier\">modified?</span>\n\
      289:         \n\
      290:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">name</span> <span class=\"ruby-operator\">&amp;&amp;</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">loader</span>.<span class=\"ruby-identifier\">is_newer?</span>( <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">name</span>, <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">create_time</span> )\n\
      291:             <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-value str\">&quot;Config source (%s) has been updated since %s&quot;</span> <span class=\"ruby-operator\">%</span>\n\
      292:                 [ <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">name</span>, <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">create_time</span> ]\n\
      293:         <span class=\"ruby-keyword kw\">end</span>\n\
      294: \n\
      295:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">nil</span>\n\
      296:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      If the configuration has changed, return the reason. If it hasn&#8216;t,
      returns nil.
      </p>
    params: ()
  - visibility: public
    aref: M000274
    name: loader=
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/arrow/config.rb, line 250</span>\n\
      250:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">loader=</span>( <span class=\"ruby-identifier\">new_loader</span> )\n\
      251:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">new_loader</span>.<span class=\"ruby-identifier\">is_a?</span>( <span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Config</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Loader</span> )\n\
      252:             <span class=\"ruby-ivar\">@loader</span> = <span class=\"ruby-identifier\">new_loader</span>\n\
      253:         <span class=\"ruby-keyword kw\">else</span>\n\
      254:             <span class=\"ruby-ivar\">@loader</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">get_loader</span>( <span class=\"ruby-identifier\">new_loader</span> )\n\
      255:         <span class=\"ruby-keyword kw\">end</span>\n\
      256:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Change the configuration object&#8216;s loader. The <tt>new_loader</tt>
      argument can be either an Arrow::Config::Loader object or the name of one
      suitable for passing to Arrow::Config::Loader.create.
      </p>
    params: ( new_loader )
  - visibility: public
    aref: M000279
    name: reload
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/arrow/config.rb, line 301</span>\n\
      301:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">reload</span>\n\
      302:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">false</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-ivar\">@loader</span> <span class=\"ruby-operator\">&amp;&amp;</span> <span class=\"ruby-ivar\">@name</span>\n\
      303:         \n\
      304:         <span class=\"ruby-comment cmt\"># Even if reloading fails, reset the creation time so we don't keep</span>\n\
      305:         <span class=\"ruby-comment cmt\"># trying to reload a broken config</span>\n\
      306:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">create_time</span> = <span class=\"ruby-constant\">Time</span>.<span class=\"ruby-identifier\">now</span>\n\
      307: \n\
      308:         <span class=\"ruby-identifier\">confighash</span> = <span class=\"ruby-ivar\">@loader</span>.<span class=\"ruby-identifier\">load</span>( <span class=\"ruby-ivar\">@name</span> )\n\
      309:         <span class=\"ruby-identifier\">ihash</span> = <span class=\"ruby-identifier\">internify_keys</span>( <span class=\"ruby-identifier\">untaint_values</span>(<span class=\"ruby-identifier\">confighash</span>) )\n\
      310:         <span class=\"ruby-identifier\">mergedhash</span> = <span class=\"ruby-constant\">DEFAULTS</span>.<span class=\"ruby-identifier\">merge</span>( <span class=\"ruby-identifier\">ihash</span>, <span class=\"ruby-operator\">&amp;</span><span class=\"ruby-constant\">Arrow</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">HashMergeFunction</span> )\n\
      311:         \n\
      312:         <span class=\"ruby-ivar\">@struct</span> = <span class=\"ruby-constant\">ConfigStruct</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">mergedhash</span> )\n\
      313: \n\
      314:     <span class=\"ruby-keyword kw\">rescue</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">err</span>\n\
      315:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">error</span> <span class=\"ruby-value str\">&quot;Error while trying to reload the config: %s&quot;</span> <span class=\"ruby-operator\">%</span> <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">message</span>\n\
      316:         <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">backtrace</span>.<span class=\"ruby-identifier\">each</span> {<span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">frame</span><span class=\"ruby-operator\">|</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">debug</span> <span class=\"ruby-value str\">&quot;  &quot;</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-identifier\">frame</span> }\n\
      317:         \n\
      318:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">false</span>\n\
      319:     <span class=\"ruby-keyword kw\">else</span>\n\
      320:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">true</span>\n\
      321:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Reload the configuration from the original source if it has changed.
      Returns <tt>true</tt> if it was reloaded and <tt>false</tt> otherwise.
      </p>
    params: ()
  - visibility: public
    aref: M000276
    name: respond_to?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/arrow/config.rb, line 271</span>\n\
      271:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">respond_to?</span>( <span class=\"ruby-identifier\">sym</span> )\n\
      272:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">true</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-ivar\">@struct</span>.<span class=\"ruby-identifier\">member?</span>( <span class=\"ruby-identifier\">sym</span>.<span class=\"ruby-identifier\">to_s</span>.<span class=\"ruby-identifier\">sub</span>(<span class=\"ruby-regexp re\">/(=|\\?)$/</span>, <span class=\"ruby-value str\">''</span>).<span class=\"ruby-identifier\">intern</span> )\n\
      273:         <span class=\"ruby-keyword kw\">super</span>\n\
      274:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Returns <tt>true</tt> for methods which can be autoloaded
      </p>
    params: ( sym )
  - visibility: public
    aref: M000275
    name: write
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/arrow/config.rb, line 261</span>\n\
      261:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">write</span>( <span class=\"ruby-identifier\">name</span>=<span class=\"ruby-ivar\">@name</span>, <span class=\"ruby-operator\">*</span><span class=\"ruby-identifier\">args</span> )\n\
      262:         <span class=\"ruby-identifier\">raise</span> <span class=\"ruby-constant\">ArgumentError</span>,\n\
      263:             <span class=\"ruby-value str\">&quot;No name associated with this config.&quot;</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-identifier\">name</span>\n\
      264:         <span class=\"ruby-identifier\">lobj</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">loader</span>\n\
      265:         <span class=\"ruby-identifier\">strHash</span> = <span class=\"ruby-identifier\">stringify_keys</span>( <span class=\"ruby-ivar\">@struct</span>.<span class=\"ruby-identifier\">to_h</span> )\n\
      266:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">loader</span>.<span class=\"ruby-identifier\">save</span>( <span class=\"ruby-identifier\">strHash</span>, <span class=\"ruby-identifier\">name</span>, <span class=\"ruby-operator\">*</span><span class=\"ruby-identifier\">args</span> )\n\
      267:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Write the configuration object using the specified name and any additional
      <tt>args</tt>.
      </p>
    params: ( name=@name, *args )
  category: Instance
  type: Public
- methods: 
  - visibility: protected
    aref: M000280
    name: method_missing
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/arrow/config.rb, line 329</span>\n\
      329:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">method_missing</span>( <span class=\"ruby-identifier\">sym</span>, <span class=\"ruby-operator\">*</span><span class=\"ruby-identifier\">args</span> )\n\
      330:         <span class=\"ruby-identifier\">key</span> = <span class=\"ruby-identifier\">sym</span>.<span class=\"ruby-identifier\">to_s</span>.<span class=\"ruby-identifier\">sub</span>( <span class=\"ruby-regexp re\">/(=|\\?)$/</span>, <span class=\"ruby-value str\">''</span> ).<span class=\"ruby-identifier\">intern</span>\n\
      331:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">nil</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-ivar\">@struct</span>.<span class=\"ruby-identifier\">member?</span>( <span class=\"ruby-identifier\">key</span> )\n\
      332: \n\
      333:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">log</span>.<span class=\"ruby-identifier\">debug</span>( <span class=\"ruby-node\">&quot;Autoloading #{key} accessors.&quot;</span> )\n\
      334: \n\
      335:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">class_eval</span> <span class=\"ruby-node\">%{\n\
      336:             def #{key}; @struct.#{key}; end\n\
      337:             def #{key}=(*args); @struct.#{key} = *args; end\n\
      338:             def #{key}?; @struct.#{key}?; end\n\
      339:         }</span>\n\
      340: \n\
      341:         <span class=\"ruby-ivar\">@struct</span>.<span class=\"ruby-identifier\">__send__</span>( <span class=\"ruby-identifier\">sym</span>, <span class=\"ruby-operator\">*</span><span class=\"ruby-identifier\">args</span> )\n\
      342:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Hook up delegators to struct-members as they are called
      </p>
    params: ( sym, *args )
  category: Instance
  type: Protected

sectitle

--- 

constants

--- 
- name: SVNRev
  desc: |+
    
    SVN Revision
    
  value: "%q$Rev: 424 $"
- name: SVNId
  desc: |+
    
    SVN Id
    
  value: "%q$Id: config.rb 424 2007-08-20 20:54:26Z phaedrus $"
- name: DEFAULTS
  desc: |+
    
    Define the layout and defaults for the underlying structs
    
  value: "{         :startMonitor     =&gt; false,          :logging          =&gt; { :global =&gt; 'notice' },          :applets =&gt; {             :path            =&gt; Arrow::Path.new( &quot;applets:/www/applets&quot; ),             :pattern     =&gt; '**/*.rb',             :pollInterval    =&gt; 5,             :layout          =&gt; {},             :config          =&gt; {},             :missingApplet   =&gt; '/missing',             :errorApplet =&gt; '/error',         },          :templates =&gt; {             :loader          =&gt; 'Arrow::Template',             :path            =&gt; Arrow::Path.new( &quot;templates:/www/templates&quot; ),             :cache           =&gt; true,             :cacheConfig =&gt; {                 :maxNum         =&gt; 20,                 :maxSize        =&gt; (1&lt;&lt;17) * 20,                 :maxObjSize     =&gt; (1&lt;&lt;17),                 :expiration     =&gt; 36"

[Validate]

Generated with the Darkfish Rdoc Generator.