Class: Rubinius::AST::Return
- Defined in:
- lib/compiler/ast/control_flow.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, expr) ⇒ Return
constructor
A new instance of Return.
- #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, expr) ⇒ Return
Returns a new instance of Return.
276 277 278 279 280 |
# File 'lib/compiler/ast/control_flow.rb', line 276 def initialize(line, expr) @line = line @value = expr @splat = nil end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
274 275 276 |
# File 'lib/compiler/ast/control_flow.rb', line 274 def value @value end |
Instance Method Details
#to_sexp ⇒ Object
282 283 284 285 286 287 |
# File 'lib/compiler/ast/control_flow.rb', line 282 def to_sexp sexp = [:return] sexp << @value.to_sexp if @value sexp << @splat.to_sexp if @splat sexp end |