class SyntaxTree::RescueMod
expression rescue value
RescueMod represents the use of the modifier form of a rescue clause.
def ===(other)
def ===(other) other.is_a?(RescueMod) && statement === other.statement && value === other.value end
def accept(visitor)
def accept(visitor) visitor.visit_rescue_mod(self) end
def child_nodes
def child_nodes [statement, value] end
def copy(statement: nil, value: nil, location: nil)
def copy(statement: nil, value: nil, location: nil) node = RescueMod.new( statement: statement || self.statement, value: value || self.value, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { statement: statement, value: value, location: location, comments: comments } end
def format(q)
def format(q) q.text("begin") q.group do q.indent do q.breakable_force q.format(statement) end q.breakable_force q.text("rescue StandardError") q.indent do q.breakable_force q.format(value) end q.breakable_force end q.text("end") end
def initialize(statement:, value:, location:)
def initialize(statement:, value:, location:) @statement = statement @value = value @location = location @comments = [] end