| Module | PageTemplate::NamespaceItem |
| In: |
lib/PageTemplate/parser.rb
|
A Namespace object consists of three things:
parent: A parent object to get a value from if the namespace does not ‘know’ a value.
object: An object is a hash or list that contains the values that this namespace will refer to. It may also be an object, in which case, its methods are treated as a hash, with respond_to? and send()
Cache: A cache ensures that a method on an object will only be called once.
| object | [RW] | |
| parent | [RW] |
Returns the first value found for key in the nested namespaces. Returns nil if no value is found.
Values are checked for in this order through each level of namespace:
If a value is not found in any of the nested namespaces, get() searches for the key in the global namespace.
If val is a dot-separated list of words, then ‘key’ is the first part of it. The remainder of the words are sent to key (and further results) to premit accessing attributes of objects.