Class: Yap::Shell::Parser::Nodes::ConditionalNode
- Inherits:
-
Object
- Object
- Yap::Shell::Parser::Nodes::ConditionalNode
- Includes:
- Visitor
- Defined in:
- lib/yap/shell/parser/nodes.rb
Instance Attribute Summary collapse
-
#expr1 ⇒ Object
readonly
Returns the value of attribute expr1.
-
#expr2 ⇒ Object
readonly
Returns the value of attribute expr2.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
Instance Method Summary collapse
-
#initialize(token, expr1, expr2) ⇒ ConditionalNode
constructor
A new instance of ConditionalNode.
- #to_s ⇒ Object
Methods included from Visitor
Constructor Details
#initialize(token, expr1, expr2) ⇒ ConditionalNode
Returns a new instance of ConditionalNode.
167 168 169 170 171 |
# File 'lib/yap/shell/parser/nodes.rb', line 167 def initialize(token, expr1, expr2) @operator = token.value @expr1 = expr1 @expr2 = expr2 end |
Instance Attribute Details
#expr1 ⇒ Object (readonly)
Returns the value of attribute expr1.
165 166 167 |
# File 'lib/yap/shell/parser/nodes.rb', line 165 def expr1 @expr1 end |
#expr2 ⇒ Object (readonly)
Returns the value of attribute expr2.
165 166 167 |
# File 'lib/yap/shell/parser/nodes.rb', line 165 def expr2 @expr2 end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
165 166 167 |
# File 'lib/yap/shell/parser/nodes.rb', line 165 def operator @operator end |
Instance Method Details
#to_s ⇒ Object
173 174 175 |
# File 'lib/yap/shell/parser/nodes.rb', line 173 def to_s "ConditionalNode(#{@operator}, #{@expr1}, #{@expr2.to_s})" end |