Skip to content

Instantly share code, notes, and snippets.

@mecampbellsoup
Last active December 23, 2015 13:39
Show Gist options
  • Save mecampbellsoup/6643930 to your computer and use it in GitHub Desktop.
Save mecampbellsoup/6643930 to your computer and use it in GitHub Desktop.
Assign args variable in the initialize method definition?
def initialize args=[name_key_value,location_key_value,ranking_key_value,students_array,instructors_array]
args.each do |k,v|
instance_variable_set("@#{k}", v) unless v.nil?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment