Browse files

demo plugin for Termtter::Event.

  • Loading branch information...
1 parent 24711bf commit 0e6fe029332165bd492efcc1f89a49ac22fedfa1 @hitode909 hitode909 committed Mar 7, 2010
Showing with 23 additions and 0 deletions.
  1. +23 −0 lib/plugins/event_invoked_at.rb
View
23 lib/plugins/event_invoked_at.rb
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+
+module Termtter::Client
+
+ register_hook(
+ :name => :set_invoked_at,
+ :point => :pre_filter,
+ :exec_proc => lambda do |statuses, event|
+ event[:invoked_at] = Time.now
+ statuses
+ end
+ )
+
+ register_hook(
+ :name => :print_invoked_at,
+ :point => :post_filter,
+ :exec_proc => lambda do |statuses, event|
+ puts "event was invoked at #{event.invoked_at}."
+ statuses
+ end
+ )
+
+end

0 comments on commit 0e6fe02

Please sign in to comment.