Subversion Info

Rev
439
Last Checked In
2008-04-10 23:27:34 (6 days ago)
Checked in by
deveiant

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)

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 /Users/ged/source/ruby/Arrow/lib/arrow/config.rb, line 179
179:     def self::get_loader( name=nil )
180:         name ||= self.default_loader
181:         self.loaders[name] ||= Arrow::Config::Loader.create( name )
182:     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 /Users/ged/source/ruby/Arrow/lib/arrow/config.rb, line 187
187:     def self::load( source, loader_obj=nil )
188:         loader_obj = self.get_loader( loader_obj ) unless
189:             loader_obj.is_a?( Arrow::Config::Loader )
190:         my_source = source.dup
191:         my_source.untaint
192:         confighash = loader_obj.load( my_source )
193: 
194:         obj = new( confighash )
195:         obj.loader = loader_obj
196:         obj.name = my_source
197: 
198:         return obj
199:     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 /Users/ged/source/ruby/Arrow/lib/arrow/config.rb, line 208
208:     def initialize( confighash={} )
209:         ihash = internify_keys( untaint_values(confighash) )
210:         mergedhash = DEFAULTS.merge( ihash, &Arrow::HashMergeFunction )
211: 
212:         @struct      = ConfigStruct.new( mergedhash )
213:         @create_time = Time.now
214:         @name        = nil
215:         @loader      = nil
216: 
217:         super()
218:     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 /Users/ged/source/ruby/Arrow/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 /Users/ged/source/ruby/Arrow/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() click to toggle source

Fetch the loader from this config object, or create an instance of the default one if none is yet associated with it.

     # File /Users/ged/source/ruby/Arrow/lib/arrow/config.rb, line 254
254:     def loader
255:         @loader ||= self.class.get_loader
256:     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 /Users/ged/source/ruby/Arrow/lib/arrow/config.rb, line 243
243:     def loader=( new_loader )
244:         if new_loader.is_a?( Arrow::Config::Loader )
245:             @loader = new_loader
246:         else
247:             @loader = self.class.get_loader( new_loader )
248:         end
249:     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 /Users/ged/source/ruby/Arrow/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 /Users/ged/source/ruby/Arrow/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 /Users/ged/source/ruby/Arrow/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 /Users/ged/source/ruby/Arrow/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: 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: M000276
    name: get_loader
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/config.rb, line 179</span>\n\
      179:     <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\
      180:         <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\
      181:         <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\
      182:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Get the <a href="Config.html#M000280">loader</a> by the given name,
      creating a <a href="Config.html#M000278">new</a> one if one is not already
      instantiated.
      </p>
    params: ( name=nil )
  - visibility: public
    aref: M000277
    name: load
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/config.rb, line 187</span>\n\
      187:     <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\
      188:         <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\
      189:             <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\
      190:         <span class=\"ruby-identifier\">my_source</span> = <span class=\"ruby-identifier\">source</span>.<span class=\"ruby-identifier\">dup</span>\n\
      191:         <span class=\"ruby-identifier\">my_source</span>.<span class=\"ruby-identifier\">untaint</span>\n\
      192:         <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\
      193: \n\
      194:         <span class=\"ruby-identifier\">obj</span> = <span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">confighash</span> )\n\
      195:         <span class=\"ruby-identifier\">obj</span>.<span class=\"ruby-identifier\">loader</span> = <span class=\"ruby-identifier\">loader_obj</span>\n\
      196:         <span class=\"ruby-identifier\">obj</span>.<span class=\"ruby-identifier\">name</span> = <span class=\"ruby-identifier\">my_source</span>\n\
      197: \n\
      198:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">obj</span>\n\
      199:     <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><a
      href="Config.html#M000280">loader</a></tt>.
      </p>
    params: ( source, loader_obj=nil )
  - visibility: public
    aref: M000278
    name: new
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/config.rb, line 208</span>\n\
      208:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">initialize</span>( <span class=\"ruby-identifier\">confighash</span>={} )\n\
      209:         <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\
      210:         <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\
      211: \n\
      212:         <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\
      213:         <span class=\"ruby-ivar\">@create_time</span> = <span class=\"ruby-constant\">Time</span>.<span class=\"ruby-identifier\">now</span>\n\
      214:         <span class=\"ruby-ivar\">@name</span>        = <span class=\"ruby-keyword kw\">nil</span>\n\
      215:         <span class=\"ruby-ivar\">@loader</span>      = <span class=\"ruby-keyword kw\">nil</span>\n\
      216: \n\
      217:         <span class=\"ruby-keyword kw\">super</span>()\n\
      218:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Create a <a href="Config.html#M000278">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: M000283
    name: changed?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/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: M000284
    name: changed_reason
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/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: M000280
    name: loader
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/config.rb, line 254</span>\n\
      254:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">loader</span>\n\
      255:         <span class=\"ruby-ivar\">@loader</span> <span class=\"ruby-operator\">||=</span> <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">get_loader</span>\n\
      256:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Fetch the <a href="Config.html#M000280">loader</a> from this config object,
      or create an instance of the default one if none is yet associated with it.
      </p>
    params: ()
  - visibility: public
    aref: M000279
    name: loader=
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/lib/arrow/config.rb, line 243</span>\n\
      243:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">loader=</span>( <span class=\"ruby-identifier\">new_loader</span> )\n\
      244:         <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\
      245:             <span class=\"ruby-ivar\">@loader</span> = <span class=\"ruby-identifier\">new_loader</span>\n\
      246:         <span class=\"ruby-keyword kw\">else</span>\n\
      247:             <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\
      248:         <span class=\"ruby-keyword kw\">end</span>\n\
      249:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Change the configuration object&#8216;s <a
      href="Config.html#M000280">loader</a>. 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: M000285
    name: reload
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/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: M000282
    name: respond_to?
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/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: M000281
    name: write
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/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: M000286
    name: method_missing
    sourcecode: "     <span class=\"ruby-comment cmt\"># File /Users/ged/source/ruby/Arrow/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: 439 $"
- name: SVNId
  desc: |+
    
    SVN Id
    
  value: "%q$Id: config.rb 439 2008-04-10 23:27:34Z deveiant $"
- name: DEFAULTS
  desc: |+
    
    Define the layout and defaults for the underlying structs
    
  value: "{         :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.