Class: Chelsy::Return

Inherits:
Stmt show all
Defined in:
lib/chelsy/ast.rb

Overview

=== 6.8.6.4 The return statement

Instance Attribute Summary collapse

Attributes inherited from Element

#fragments, #post_fragments

Instance Method Summary collapse

Constructor Details

#initialize(expr = nil, **rest) ⇒ Return

Returns a new instance of Return.



1094
1095
1096
1097
1098
# File 'lib/chelsy/ast.rb', line 1094

def initialize(expr=nil, **rest)
  @expr = Syntax::Expr.ensure(expr) if expr

  super(**rest)
end

Instance Attribute Details

#exprObject (readonly)

Returns the value of attribute expr.



1092
1093
1094
# File 'lib/chelsy/ast.rb', line 1092

def expr
  @expr
end