Class: Melbourne::AST::Return

Inherits:
Node
  • Object
show all
Defined in:
lib/melbourne/ast/control_flow.rb

Overview

A return statement as in:

def method
  return 3
end

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, expr) ⇒ Return

Returns a new instance of Return.



372
373
374
375
376
# File 'lib/melbourne/ast/control_flow.rb', line 372

def initialize(line, expr)
  @line = line
  @value = expr
  @splat = nil
end

Instance Attribute Details

#valueObject

The value passed to return



370
371
372
# File 'lib/melbourne/ast/control_flow.rb', line 370

def value
  @value
end