Class: Melbourne::AST::Ensure
- Defined in:
- lib/melbourne/ast/exceptions.rb
Overview
An ensure statement as in:
begin
do
rescue
puts 'error'
ensure
clean
end
Instance Attribute Summary collapse
-
#body ⇒ Object
The body of the
ensurestatement. -
#ensure ⇒ Object
A literal if one is defined as the only statement in the
ensurestatement.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, body, ensr) ⇒ Ensure
constructor
A new instance of Ensure.
Methods inherited from Node
Constructor Details
#initialize(line, body, ensr) ⇒ Ensure
Returns a new instance of Ensure.
48 49 50 51 52 |
# File 'lib/melbourne/ast/exceptions.rb', line 48 def initialize(line, body, ensr) @line = line @body = body || Nil.new(line) @ensure = ensr end |
Instance Attribute Details
#body ⇒ Object
The body of the ensure statement
42 43 44 |
# File 'lib/melbourne/ast/exceptions.rb', line 42 def body @body end |
#ensure ⇒ Object
A literal if one is defined as the only statement in the ensure statement
46 47 48 |
# File 'lib/melbourne/ast/exceptions.rb', line 46 def ensure @ensure end |