Class: SyntaxTree::Retry
Overview
Retry represents the use of the retry keyword.
retry
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: []) ⇒ Retry
constructor
A new instance of Retry.
Methods inherited from Node
Constructor Details
#initialize(value:, location:, comments: []) ⇒ Retry
Returns a new instance of Retry.
7625 7626 7627 7628 7629 |
# File 'lib/syntax_tree/node.rb', line 7625 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
7623 7624 7625 |
# File 'lib/syntax_tree/node.rb', line 7623 def comments @comments end |
#value ⇒ Object (readonly)
- String
-
the value of the keyword
7620 7621 7622 |
# File 'lib/syntax_tree/node.rb', line 7620 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
7631 7632 7633 |
# File 'lib/syntax_tree/node.rb', line 7631 def accept(visitor) visitor.visit_retry(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
7635 7636 7637 |
# File 'lib/syntax_tree/node.rb', line 7635 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
7641 7642 7643 |
# File 'lib/syntax_tree/node.rb', line 7641 def deconstruct_keys(keys) { value: value, location: location, comments: comments } end |
#format(q) ⇒ Object
7645 7646 7647 |
# File 'lib/syntax_tree/node.rb', line 7645 def format(q) q.text(value) end |