Class: Rubinius::AST::Ensure
- Defined in:
- lib/compiler/ast/exceptions.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#ensure ⇒ Object
Returns the value of attribute ensure.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, body, ensr) ⇒ Ensure
constructor
A new instance of Ensure.
- #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, ensr) ⇒ Ensure
Returns a new instance of Ensure.
23 24 25 26 27 |
# File 'lib/compiler/ast/exceptions.rb', line 23 def initialize(line, body, ensr) @line = line @body = body || NilLiteral.new(line) @ensure = ensr end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
21 22 23 |
# File 'lib/compiler/ast/exceptions.rb', line 21 def body @body end |
#ensure ⇒ Object
Returns the value of attribute ensure.
21 22 23 |
# File 'lib/compiler/ast/exceptions.rb', line 21 def ensure @ensure end |
Instance Method Details
#to_sexp ⇒ Object
29 30 31 |
# File 'lib/compiler/ast/exceptions.rb', line 29 def to_sexp [:ensure, @body.to_sexp, @ensure.to_sexp] end |