Class: Melbourne::AST::Begin

Inherits:
Node
  • Object
show all
Defined in:
lib/melbourne/ast/exceptions.rb

Overview

A begin statement as in:

begin
  do
rescue
  puts 'error'
end

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, body) ⇒ Begin

Returns a new instance of Begin.



19
20
21
22
# File 'lib/melbourne/ast/exceptions.rb', line 19

def initialize(line, body)
  @line = line
  @rescue = body
end

Instance Attribute Details

#rescueObject

The rescue statement to the begin statement id there is any



17
18
19
# File 'lib/melbourne/ast/exceptions.rb', line 17

def rescue
  @rescue
end