Class: Yap::Shell::Parser::Nodes::EnvNode

Inherits:
Object
  • Object
show all
Includes:
Visitor
Defined in:
lib/yap/shell/parser/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Visitor

#accept

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

#envObject (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