Class: Yap::Shell::Parser::Nodes::BlockNode
- Inherits:
-
Object
- Object
- Yap::Shell::Parser::Nodes::BlockNode
- Includes:
- Visitor
- Defined in:
- lib/yap/shell/parser/nodes.rb
Instance Attribute Summary collapse
-
#head ⇒ Object
Returns the value of attribute head.
-
#params ⇒ Object
Returns the value of attribute params.
-
#tail ⇒ Object
Returns the value of attribute tail.
Instance Method Summary collapse
-
#initialize(head, tail, params: nil) ⇒ BlockNode
constructor
A new instance of BlockNode.
- #inspect ⇒ Object
- #to_s(indent: 0) ⇒ Object
Methods included from Visitor
Constructor Details
#initialize(head, tail, params: nil) ⇒ BlockNode
Returns a new instance of BlockNode.
291 292 293 294 295 |
# File 'lib/yap/shell/parser/nodes.rb', line 291 def initialize(head, tail, params: nil) @head = head @tail = tail @params = params ? params.value : [] end |
Instance Attribute Details
#head ⇒ Object
Returns the value of attribute head.
289 290 291 |
# File 'lib/yap/shell/parser/nodes.rb', line 289 def head @head end |
#params ⇒ Object
Returns the value of attribute params.
289 290 291 |
# File 'lib/yap/shell/parser/nodes.rb', line 289 def params @params end |
#tail ⇒ Object
Returns the value of attribute tail.
289 290 291 |
# File 'lib/yap/shell/parser/nodes.rb', line 289 def tail @tail end |
Instance Method Details
#inspect ⇒ Object
305 306 307 |
# File 'lib/yap/shell/parser/nodes.rb', line 305 def inspect to_s end |
#to_s(indent: 0) ⇒ Object
297 298 299 300 301 302 303 |
# File 'lib/yap/shell/parser/nodes.rb', line 297 def to_s(indent:0) if @counter_reference "BlockNode(#{@head.inspect}, tail: #{@tail.inspect} params: #{@params.inspect})" else "BlockNode(#{@head.inspect}, tail: #{@tail.inspect} params: #{@params.inspect})" end end |