Class: Rubydraw::Events::UnknownEvent

Inherits:
Event show all
Defined in:
lib/rubydraw/events.rb

Overview

A special event class that is called when no Rubydraw event is matched to an SDL event.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Event

#event?, from_sdl_event, matches?, matching_sdl_type, wants_to_match?

Constructor Details

#initialize(sdl_event) ⇒ UnknownEvent

Returns a new instance of UnknownEvent.



76
77
78
# File 'lib/rubydraw/events.rb', line 76

def initialize(sdl_event)
  @sdl_event = sdl_event
end

Instance Attribute Details

#sdl_eventObject (readonly)

Returns the value of attribute sdl_event.



74
75
76
# File 'lib/rubydraw/events.rb', line 74

def sdl_event
  @sdl_event
end

Instance Method Details

#from_sdl_event(sdl_event) ⇒ Object

The SDL event should be passed so that the programmer using this library can still attempt to implement behavior, but it will have to match and SDL event, not a Rubydraw Event.



70
71
72
# File 'lib/rubydraw/events.rb', line 70

def from_sdl_event(sdl_event)
  self.new(sdl_event)
end