Class: Yap::Shell::Parser::Nodes::PipelineNode
- Inherits:
-
Object
- Object
- Yap::Shell::Parser::Nodes::PipelineNode
- Includes:
- Visitor
- Defined in:
- lib/yap/shell/parser/nodes.rb
Instance Attribute Summary collapse
-
#head ⇒ Object
readonly
Returns the value of attribute head.
-
#tail ⇒ Object
readonly
Returns the value of attribute tail.
Instance Method Summary collapse
-
#initialize(head, tail) ⇒ PipelineNode
constructor
A new instance of PipelineNode.
- #inspect ⇒ Object
- #to_s(indent: 0) ⇒ Object
Methods included from Visitor
Constructor Details
#initialize(head, tail) ⇒ PipelineNode
Returns a new instance of PipelineNode.
210 211 212 213 |
# File 'lib/yap/shell/parser/nodes.rb', line 210 def initialize(head, tail) @head = head @tail = tail end |
Instance Attribute Details
#head ⇒ Object (readonly)
Returns the value of attribute head.
208 209 210 |
# File 'lib/yap/shell/parser/nodes.rb', line 208 def head @head end |
#tail ⇒ Object (readonly)
Returns the value of attribute tail.
208 209 210 |
# File 'lib/yap/shell/parser/nodes.rb', line 208 def tail @tail end |
Instance Method Details
#inspect ⇒ Object
223 224 225 |
# File 'lib/yap/shell/parser/nodes.rb', line 223 def inspect to_s end |
#to_s(indent: 0) ⇒ Object
215 216 217 218 219 220 221 |
# File 'lib/yap/shell/parser/nodes.rb', line 215 def to_s(indent:0) " | \#{' ' * indent}PipelineNode(\n | \#{' ' * indent} \#{@head.to_s},\n | \#{' ' * indent} \#{@tail.to_s})\n EOT\nend\n".gsub(/^\s+\|/, '') |