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
#construct_keys, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:, comments: []) ⇒ Retry
Returns a new instance of Retry.
7725 7726 7727 7728 7729 |
# File 'lib/syntax_tree/node.rb', line 7725 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
7723 7724 7725 |
# File 'lib/syntax_tree/node.rb', line 7723 def comments @comments end |
#value ⇒ Object (readonly)
- String
-
the value of the keyword
7720 7721 7722 |
# File 'lib/syntax_tree/node.rb', line 7720 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
7731 7732 7733 |
# File 'lib/syntax_tree/node.rb', line 7731 def accept(visitor) visitor.visit_retry(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
7735 7736 7737 |
# File 'lib/syntax_tree/node.rb', line 7735 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
7741 7742 7743 |
# File 'lib/syntax_tree/node.rb', line 7741 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end |
#format(q) ⇒ Object
7745 7746 7747 |
# File 'lib/syntax_tree/node.rb', line 7745 def format(q) q.text(value) end |