Class: Rubinius::AST::Rescue
- Defined in:
- lib/compiler/ast/exceptions.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#else ⇒ Object
Returns the value of attribute else.
-
#rescue ⇒ Object
Returns the value of attribute rescue.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, body, rescue_body, else_body) ⇒ Rescue
constructor
A new instance of Rescue.
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk
Constructor Details
#initialize(line, body, rescue_body, else_body) ⇒ Rescue
Returns a new instance of Rescue.
39 40 41 42 43 44 |
# File 'lib/compiler/ast/exceptions.rb', line 39 def initialize(line, body, rescue_body, else_body) @line = line @body = body @rescue = rescue_body @else = else_body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
37 38 39 |
# File 'lib/compiler/ast/exceptions.rb', line 37 def body @body end |
#else ⇒ Object
Returns the value of attribute else.
37 38 39 |
# File 'lib/compiler/ast/exceptions.rb', line 37 def else @else end |
#rescue ⇒ Object
Returns the value of attribute rescue.
37 38 39 |
# File 'lib/compiler/ast/exceptions.rb', line 37 def rescue @rescue end |
Instance Method Details
#to_sexp ⇒ Object
46 47 48 49 50 |
# File 'lib/compiler/ast/exceptions.rb', line 46 def to_sexp sexp = [:rescue, @body.to_sexp, @rescue.to_sexp] sexp << @else.to_sexp if @else sexp end |