Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

9.1.9. Callbacks

At the beginning of this section, we encountered the invoking of callbacks. Now let’s discover how application developers can create these callbacks. Here is the source that enables us to do this:

module Merb
  class Authentication
    cattr_accessor :after_callbacks
    @@after_callbacks = []

    # @api public
						def self.after_authentication(*callbacks, &block)
      self.after_callbacks = after_callbacks +
        callbacks.flatten unless callbacks.blank?

      after_callbacks << block if block_given?
    end
						end
						end


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint