Skip to content

Namespacing

mosop edited this page Nov 24, 2016 · 12 revisions

Passing the :namespace argument to the Callback.enable method, you can use the library's features in your own namespace.

class Conflictive
  def self.define_callback_group
    #...
  end
end

class MyClass < Conflictive
  Callback.enable namespace: "my"
  define_my_callback_group :group

  before_my_group do
    # ...
  end

  def invoke
    run_my_callbacks_for_group do
      # ...
    end
  end
end

Clone this wiki locally