Class: TPPlus::Nodes::NamespaceNode
- Defined in:
- lib/tp_plus/nodes/namespace_node.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
- #eval(context) ⇒ Object
-
#initialize(name, block) ⇒ NamespaceNode
constructor
A new instance of NamespaceNode.
Methods inherited from BaseNode
Constructor Details
#initialize(name, block) ⇒ NamespaceNode
Returns a new instance of NamespaceNode.
5 6 7 8 |
# File 'lib/tp_plus/nodes/namespace_node.rb', line 5 def initialize(name, block) @name = name @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
4 5 6 |
# File 'lib/tp_plus/nodes/namespace_node.rb', line 4 def block @block end |
Instance Method Details
#eval(context) ⇒ Object
10 11 12 13 |
# File 'lib/tp_plus/nodes/namespace_node.rb', line 10 def eval(context) context.add_namespace(@name, @block) nil end |