Class: LibRubyParser::Nodes::RescueBody

Inherits:
LibRubyParser::Node show all
Defined in:
lib/lib-ruby-parser/nodes.rb

Overview

Represents a single rescue handler (i.e. ‘rescue E => e …`)

Instance Attribute Summary collapse

Instance Attribute Details

#assoc_lLoc? (readonly)

Location of the ‘=>` operator

“‘text begin; 1; rescue E => e; 2; end

~~

“‘

None if exception is not captured.

Returns:



3567
3568
3569
# File 'lib/lib-ruby-parser/nodes.rb', line 3567

def assoc_l
  @assoc_l
end

#begin_lLoc? (readonly)

Location of the then keyword

“‘text begin; 1; rescue E => e then; 2; end

~~~~

“‘

then is optional, so begin_l can be None

Returns:



3578
3579
3580
# File 'lib/lib-ruby-parser/nodes.rb', line 3578

def begin_l
  @begin_l
end

#bodyNode? (readonly)

Body of the handler

Returns:



3547
3548
3549
# File 'lib/lib-ruby-parser/nodes.rb', line 3547

def body
  @body
end

#exc_listNode? (readonly)

A list of exception classes

None if no classes specified (i.e. ‘rescue => e; …` or just `rescue; …`)

Returns:



3537
3538
3539
# File 'lib/lib-ruby-parser/nodes.rb', line 3537

def exc_list
  @exc_list
end

#exc_varNode? (readonly)

Variable that captures exception

None if no variable specified (i.e. ‘rescue E; …` or just `rescue; … `)

Returns:



3543
3544
3545
# File 'lib/lib-ruby-parser/nodes.rb', line 3543

def exc_var
  @exc_var
end

#expression_lLoc (readonly)

Location of the full expression

“‘text begin; 1; rescue E => e then; 2; end

~~~~~~~~~~~~~~~~~~~~~

“‘

Returns:



3587
3588
3589
# File 'lib/lib-ruby-parser/nodes.rb', line 3587

def expression_l
  @expression_l
end

#keyword_lLoc (readonly)

Location of the rescue keyword

“‘text begin; 1; rescue E => e; 2; end

~~~~~~

“‘

Returns:



3556
3557
3558
# File 'lib/lib-ruby-parser/nodes.rb', line 3556

def keyword_l
  @keyword_l
end