A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://ruby-syntax-tree.github.io/syntax_tree/SyntaxTree/RescueEx.html below:

class SyntaxTree::RescueEx - RDoc Documentation

  1. SyntaxTree::
  2. RescueEx
class SyntaxTree::RescueEx

RescueEx represents the list of exceptions being rescued in a rescue clause.

begin
rescue Exception => exception
end
Attributes
nil | Node

the list of exceptions being rescued

nil | Field | VarField

the expression being used to capture the raised

exception

Public Class Methods

Source

def initialize(exceptions:, variable:, location:)
  @exceptions = exceptions
  @variable = variable
  @location = location
  @comments = []
end
Public Instance Methods

Source

def ===(other)
  other.is_a?(RescueEx) && exceptions === other.exceptions &&
    variable === other.variable
end

Source

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

Source

def child_nodes
  [*exceptions, variable]
end

Source

def copy(exceptions: nil, variable: nil, location: nil)
  node =
    RescueEx.new(
      exceptions: exceptions || self.exceptions,
      variable: variable || self.variable,
      location: location || self.location
    )

  node.comments.concat(comments.map(&:copy))
  node
end

Source

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

Source

def format(q)
  q.group do
    if exceptions
      q.text(" ")
      q.format(exceptions)
    end

    if variable
      q.text(" => ")
      q.format(variable)
    end
  end
end

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4