Class: CodeTools::AST::Begin
- Defined in:
- lib/rubinius/code/ast/exceptions.rb
Instance Attribute Summary collapse
-
#rescue ⇒ Object
Returns the value of attribute rescue.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
- #defined(g) ⇒ Object
-
#initialize(line, body) ⇒ Begin
constructor
A new instance of Begin.
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk
Constructor Details
#initialize(line, body) ⇒ Begin
Returns a new instance of Begin.
8 9 10 11 |
# File 'lib/rubinius/code/ast/exceptions.rb', line 8 def initialize(line, body) @line = line @rescue = body || NilLiteral.new(line) end |
Instance Attribute Details
#rescue ⇒ Object
Returns the value of attribute rescue.
6 7 8 |
# File 'lib/rubinius/code/ast/exceptions.rb', line 6 def rescue @rescue end |
Instance Method Details
#bytecode(g) ⇒ Object
13 14 15 |
# File 'lib/rubinius/code/ast/exceptions.rb', line 13 def bytecode(g) @rescue.bytecode(g) end |
#defined(g) ⇒ Object
17 18 19 20 |
# File 'lib/rubinius/code/ast/exceptions.rb', line 17 def defined(g) return @rescue.defined(g) if @rescue g.push_literal "nil" end |
#to_sexp ⇒ Object
22 23 24 |
# File 'lib/rubinius/code/ast/exceptions.rb', line 22 def to_sexp @rescue.to_sexp end |