Skip to content

Instantly share code, notes, and snippets.

@r00k
Last active March 5, 2016 11:33
Show Gist options
  • Save r00k/48dc0d06feb617cbc21f to your computer and use it in GitHub Desktop.
Save r00k/48dc0d06feb617cbc21f to your computer and use it in GitHub Desktop.
Ruby Quiz Question 1

Hello there fine madam or sir!

I have a short quiz for you. It won't take long.

By the way, don't worry if there are questions you can't answer. Lots of people will be struggling along with you, so don't feel bad. You're not alone.

Let's begin!

Do you recognize the method for which this is the (simplified) source?

def mystery_method(accumulator)
  each do |element|
    accumulator = yield accumulator, element
  end

  accumulator
end

Click here for the answer, and Question 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment