Class: Poro::ContextFactories::NamespaceFactory::CacheNode
- Inherits:
-
Object
- Object
- Poro::ContextFactories::NamespaceFactory::CacheNode
- Defined in:
- lib/poro/context_factories/namespace_factory.rb
Overview
The internal class used to manage the namespace tree. This should never be used outside of this factory.
This class stores the child notes for the namespace, as well as the factory for this level in the namespace.
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the children–as a hash.
-
#factory ⇒ Object
Returns the factory for this node, or nil if there is none.
Instance Method Summary collapse
-
#initialize ⇒ CacheNode
constructor
Initialize an empty node.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ CacheNode
Initialize an empty node.
93 94 95 96 |
# File 'lib/poro/context_factories/namespace_factory.rb', line 93 def initialize @children = {} @factory = nil end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the children–as a hash. The keys are the module/class name, and the values are the associated child node.
This is the raw hash and can be manipulated directly.
102 103 104 |
# File 'lib/poro/context_factories/namespace_factory.rb', line 102 def children @children end |
#factory ⇒ Object
Returns the factory for this node, or nil if there is none.
105 106 107 |
# File 'lib/poro/context_factories/namespace_factory.rb', line 105 def factory @factory end |
Instance Method Details
#to_s ⇒ Object
110 111 112 |
# File 'lib/poro/context_factories/namespace_factory.rb', line 110 def to_s return {:factory => factory, :children => children}.inspect end |