Over a million developers have joined DZone.

Create And Set Instance Variables From Method Parameters / Arguments

·
Inserted at the top of the method body, this line creates instance variables for each of the method parameters and sets them to their respective argument values.

local_variables.each { |v| eval("@#{v}=eval(v)") }
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}