EventTarget::Event (Class)

In: EventTarget.rb
Parent: Object

Represents an event that has occured. Used by EventTarget#dispatch_event to fire off events registered via EventTarget#add_event_listener, based on the type of the event.

Methods

new  

Attributes

change  [RW]  This dummy value exists to easily specify information about the event, to pass from the event dispatcher to any callback methods.
target  [RW]  Automatically set by EventTarget#dispatch_event, points to the context (instance) that fired the event.
timestamp  [RW]  Automatically set by EventTarget#dispatch_event, a Time instance representing the moment the event was fired off.
type  [RW]  A symbol that uniquely identifies this type of event.

Public Class methods

type:A symbol value which uniquely identifies the type of the event. Will be matched against the type parameter passed to add_event_listener to decide which callbacks (if any) to fire.
change:An initial value for the change property. (See above; may be any type, any value.)

Example:

  def value=( new_v )
    @value = new_v
    dispatch_event Event.new( :change, new_v )
  end

[Validate]