class Rubygame::EventTriggers::InstanceOfTrigger
InstanceOfTrigger is an event trigger which fires when the event is an instance of the given class. (In other words, when event.instance_of?( klass ) is true.)
Contrast with KindOfTrigger.
Public Class Methods
new( klass )
click to toggle source
Initialize a new instance of InstanceOfTrigger with the given class.
- klass
-
The class to check for. (Class, required)
# File lib/rubygame/event_triggers.rb, line 291 def initialize( klass ) @klass = klass end
Public Instance Methods
match?( event )
click to toggle source
Returns true if the event is an instance of the class.
# File lib/rubygame/event_triggers.rb, line 297 def match?( event ) event.instance_of?( @klass ) end