Class: Yap::Shell::Parser::Nodes::EnvNode
- Inherits:
-
Object
- Object
- Yap::Shell::Parser::Nodes::EnvNode
- Includes:
- Visitor
- Defined in:
- lib/yap/shell/parser/nodes.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #add_var(token, argument_node) ⇒ Object
-
#initialize(token, argument_node) ⇒ EnvNode
constructor
A new instance of EnvNode.
Methods included from Visitor
Constructor Details
#initialize(token, argument_node) ⇒ EnvNode
Returns a new instance of EnvNode.
110 111 112 113 |
# File 'lib/yap/shell/parser/nodes.rb', line 110 def initialize(token, argument_node) @env = {} @env[token.value] = argument_node end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
108 109 110 |
# File 'lib/yap/shell/parser/nodes.rb', line 108 def env @env end |
Instance Method Details
#add_var(token, argument_node) ⇒ Object
115 116 117 |
# File 'lib/yap/shell/parser/nodes.rb', line 115 def add_var(token, argument_node) @env[token.value] = argument_node end |