Class: SyntaxTree::Retry

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/node.rb

Overview

Retry represents the use of the retry keyword.

retry

Instance Attribute Summary collapse

Attributes inherited from Node

#location

Instance Method Summary collapse

Methods inherited from Node

#construct_keys, #pretty_print, #to_json

Constructor Details

#initialize(value:, location:, comments: []) ⇒ Retry

Returns a new instance of Retry.



7903
7904
7905
7906
7907
# File 'lib/syntax_tree/node.rb', line 7903

def initialize(value:, location:, comments: [])
  @value = value
  @location = location
  @comments = comments
end

Instance Attribute Details

#commentsObject (readonly)

Array[ Comment | EmbDoc ]

the comments attached to this node



7901
7902
7903
# File 'lib/syntax_tree/node.rb', line 7901

def comments
  @comments
end

#valueObject (readonly)

String

the value of the keyword



7898
7899
7900
# File 'lib/syntax_tree/node.rb', line 7898

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



7909
7910
7911
# File 'lib/syntax_tree/node.rb', line 7909

def accept(visitor)
  visitor.visit_retry(self)
end

#child_nodesObject Also known as: deconstruct



7913
7914
7915
# File 'lib/syntax_tree/node.rb', line 7913

def child_nodes
  []
end

#deconstruct_keys(_keys) ⇒ Object



7919
7920
7921
# File 'lib/syntax_tree/node.rb', line 7919

def deconstruct_keys(_keys)
  { value: value, location: location, comments: comments }
end

#format(q) ⇒ Object



7923
7924
7925
# File 'lib/syntax_tree/node.rb', line 7923

def format(q)
  q.text(value)
end