Class: Yap::Shell::Parser::Nodes::CommandNode
- Inherits:
-
Object
- Object
- Yap::Shell::Parser::Nodes::CommandNode
- Includes:
- Visitor
- Defined in:
- lib/yap/shell/parser/nodes.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#heredoc ⇒ Object
Returns the value of attribute heredoc.
-
#redirects ⇒ Object
Returns the value of attribute redirects.
Instance Method Summary collapse
- #heredoc? ⇒ Boolean
-
#initialize(token, *args, literal: false, heredoc: nil) ⇒ CommandNode
constructor
A new instance of CommandNode.
- #inspect ⇒ Object
- #internally_evaluate? ⇒ Boolean
- #literal? ⇒ Boolean
- #to_s ⇒ Object
Methods included from Visitor
Constructor Details
#initialize(token, *args, literal: false, heredoc: nil) ⇒ CommandNode
Returns a new instance of CommandNode.
58 59 60 61 62 63 64 |
# File 'lib/yap/shell/parser/nodes.rb', line 58 def initialize(token, *args, literal:false, heredoc:nil) @command = token.value @args = args.flatten @literal = literal @heredoc = nil @redirects = [] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
55 56 57 |
# File 'lib/yap/shell/parser/nodes.rb', line 55 def args @args end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
55 56 57 |
# File 'lib/yap/shell/parser/nodes.rb', line 55 def command @command end |
#heredoc ⇒ Object
Returns the value of attribute heredoc.
56 57 58 |
# File 'lib/yap/shell/parser/nodes.rb', line 56 def heredoc @heredoc end |
#redirects ⇒ Object
Returns the value of attribute redirects.
56 57 58 |
# File 'lib/yap/shell/parser/nodes.rb', line 56 def redirects @redirects end |
Instance Method Details
#heredoc? ⇒ Boolean
70 71 72 |
# File 'lib/yap/shell/parser/nodes.rb', line 70 def heredoc? @heredoc end |
#inspect ⇒ Object
78 79 80 |
# File 'lib/yap/shell/parser/nodes.rb', line 78 def inspect to_s end |
#internally_evaluate? ⇒ Boolean
74 75 76 |
# File 'lib/yap/shell/parser/nodes.rb', line 74 def internally_evaluate? false end |
#literal? ⇒ Boolean
66 67 68 |
# File 'lib/yap/shell/parser/nodes.rb', line 66 def literal? @literal end |
#to_s ⇒ Object
82 83 84 |
# File 'lib/yap/shell/parser/nodes.rb', line 82 def to_s "CommandNode(#{@command}, args: #{@args}, literal:#{literal?}, heredoc: #{heredoc?}, redirects: #{redirects})" end |