Class: Estreet::ReturnStatement

Inherits:
Statement show all
Defined in:
lib/estreet/return_statement.rb

Instance Attribute Summary

Attributes inherited from Node

#source_location

Instance Method Summary collapse

Methods inherited from Statement

#<<, #to_statement

Methods inherited from Node

#as_json, #loc, #type

Constructor Details

#initialize(argument = nil) ⇒ ReturnStatement

Returns a new instance of ReturnStatement.



3
4
5
# File 'lib/estreet/return_statement.rb', line 3

def initialize(argument=nil)
  @argument = argument.to_expression if argument
end

Instance Method Details

#attributesObject



7
8
9
# File 'lib/estreet/return_statement.rb', line 7

def attributes
  super.merge(argument: @argument)
end