Skip to content

Instantly share code, notes, and snippets.

@stephenrichards
Created February 11, 2019 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephenrichards/28f4badbd8b0a6ddb883a74ece90584c to your computer and use it in GitHub Desktop.
Save stephenrichards/28f4badbd8b0a6ddb883a74ece90584c to your computer and use it in GitHub Desktop.
# create the EvenOnlyArray class so that this works
eoa = EvenOnlyArray.new 3,55,12,44,26,37
eoa.each_even { |x| puts x * 2 }
# expected output:
# 24
# 88
# 52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment