Class: SyntaxTree::Redo
Overview
Redo represents the use of the redo
keyword.
redo
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
- Array[ Comment | EmbDoc ]
-
the comments attached to this node.
-
#value ⇒ Object
readonly
- String
-
the value of the keyword.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(_keys) ⇒ Object
- #format(q) ⇒ Object
-
#initialize(value:, location:, comments: []) ⇒ Redo
constructor
A new instance of Redo.
Methods inherited from Node
#construct_keys, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:, comments: []) ⇒ Redo
Returns a new instance of Redo.
7216 7217 7218 7219 7220 |
# File 'lib/syntax_tree/node.rb', line 7216 def initialize(value:, location:, comments: []) @value = value @location = location @comments = comments end |
Instance Attribute Details
#comments ⇒ Object (readonly)
- Array[ Comment | EmbDoc ]
-
the comments attached to this node
7214 7215 7216 |
# File 'lib/syntax_tree/node.rb', line 7214 def comments @comments end |
#value ⇒ Object (readonly)
- String
-
the value of the keyword
7211 7212 7213 |
# File 'lib/syntax_tree/node.rb', line 7211 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
7222 7223 7224 |
# File 'lib/syntax_tree/node.rb', line 7222 def accept(visitor) visitor.visit_redo(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
7226 7227 7228 |
# File 'lib/syntax_tree/node.rb', line 7226 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
7232 7233 7234 |
# File 'lib/syntax_tree/node.rb', line 7232 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end |
#format(q) ⇒ Object
7236 7237 7238 |
# File 'lib/syntax_tree/node.rb', line 7236 def format(q) q.text(value) end |