CSC/ECE 517 Summer 2008/wiki1 5 bk

From Expertiza_Wiki
Jump to navigation Jump to search

Understanding Hooks

The hooking mechanism in Ruby allows certain functional events in a program to be identified while providing an action that will occur upon detection of the specified event. In this way, hooks serve as a detector of actions within the code. Examples of where such a technique would prove useful include:

  • Recording when or how many times a method is called.
  • Recording when an object is created.

Understanding Aspect Oriented Programming