Class: Yap::Shell::Parser::Nodes::RedirectionNode
- Inherits:
-
Object
- Object
- Yap::Shell::Parser::Nodes::RedirectionNode
- Includes:
- Visitor
- Defined in:
- lib/yap/shell/parser/nodes.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(token) ⇒ RedirectionNode
constructor
A new instance of RedirectionNode.
- #inspect ⇒ Object
- #to_s(indent: 0) ⇒ Object
Methods included from Visitor
Constructor Details
#initialize(token) ⇒ RedirectionNode
Returns a new instance of RedirectionNode.
233 234 235 236 |
# File 'lib/yap/shell/parser/nodes.rb', line 233 def initialize(token) @kind = token.value @target = token.attrs[:target] end |
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
231 232 233 |
# File 'lib/yap/shell/parser/nodes.rb', line 231 def kind @kind end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
231 232 233 |
# File 'lib/yap/shell/parser/nodes.rb', line 231 def target @target end |
Instance Method Details
#inspect ⇒ Object
242 243 244 |
# File 'lib/yap/shell/parser/nodes.rb', line 242 def inspect to_s end |
#to_s(indent: 0) ⇒ Object
238 239 240 |
# File 'lib/yap/shell/parser/nodes.rb', line 238 def to_s(indent:0) "RedirectionNode(#{@kind.to_s}, #{@target.to_s})" end |