def on_tag(obj=nil, &block)
	  @on_tag_obj = obj
      @on_tag = Proc.new { |device, obj_ptr, tag, proto|
		yield self, tag.read_string, object_for(obj_ptr)
	}
      Klass.set_OnTag2_Handler(@handle, @on_tag, pointer_for(obj))
    end
def on_tag(obj=nil, &block)
	  @on_tag_obj = obj
      @on_tag = Proc.new { |device, obj_ptr, tag, proto|
		yield self, tag.read_string, object_for(obj_ptr)
	}
      Klass.set_OnTag2_Handler(@handle, @on_tag, pointer_for(obj))
    end
Sets a tag handler callback function. This is called when a new tag is seen by the reader. The event is only fired one time for a new tag, so the tag has to be removed and then replaced before another tag gained event will fire.

 @param [String] obj Object to pass to the callback function. This is optional.
 @param [Proc] Block When the callback is executed, the device and object are yielded to this block.
 @example
     rfid.on_tag do |device, tag, obj|
       puts "Tag #{tag} detected"
     end
 As this runs in it's own thread, be sure that all errors are properly handled or the thread will halt and not fire any more.
 @return [Boolean] returns true or raises an error