Module: Zircon::Callback

Included in:
Zircon
Defined in:
lib/zircon/callback.rb

Overview

You can call methods like this:

  • list_message : return Array of callbacks for “message”

  • on_message : store a given block as callback for “message”

  • trigger_message : trigger callbacks for “message” with given args

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object (private)



9
10
11
12
13
14
15
# File 'lib/zircon/callback.rb', line 9

def method_missing(method_name, *args, &block)
  if method_name =~ /(list|on|trigger)_([a-z0-9]+)/
    send($1, $2, *args, &block)
  else
    super
  end
end