Class: Rubinius::AST::Ensure

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

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

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

#bodyObject

Returns the value of attribute body.



21
22
23
# File 'lib/compiler/ast/exceptions.rb', line 21

def body
  @body
end

#ensureObject

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_sexpObject



29
30
31
# File 'lib/compiler/ast/exceptions.rb', line 29

def to_sexp
  [:ensure, @body.to_sexp, @ensure.to_sexp]
end