Finding Where a Method is Defined
One great thing about Ruby is how flexible it is. Although sometimes it can be hard to determine where a method definition comes from.
One useful technique to pull out in just this circumstance is the
For example, suppose you see a call to the
quantity method in a spec and you wonder where its definition comes from.
Do some puts debugging by adding this line: