Sha256: 55df062b31208f8b4856314474bc77aa7932c19c1ba0f39999921c12cec58d0e

Contents?: true

Size: 379 Bytes

Versions: 1

Compression:

Stored size: 379 Bytes

Contents

module Lookbook
  module Hooks
    def after_initialize(&block)
      add_hook(:after_initialize, block)
    end

    def before_exit(&block)
      add_hook(:before_exit, block)
    end

    def after_change(&block)
      add_hook(:after_change, block)
    end

    protected

    def add_hook(event_name, block)
      Lookbook.config.hooks[event_name] << block
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lookbook-1.0.0.beta.7 lib/lookbook/hooks.rb