Class: Fet::Ui::CustomEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/fet/ui/custom_event.rb

Overview

Custom events for the event loop

Constant Summary collapse

EVENT_TYPE_NOTE_SELECTED =
:note_selected
EVENT_TYPE_LEVEL_STARTED =
:level_started
EVENT_TYPE_LEVEL_COMPLETE =
:level_complete
EVENT_TYPES =
[
  EVENT_TYPE_NOTE_SELECTED,
  EVENT_TYPE_LEVEL_STARTED,
  EVENT_TYPE_LEVEL_COMPLETE,
].deep_freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ CustomEvent

Returns a new instance of CustomEvent.



18
19
20
21
# File 'lib/fet/ui/custom_event.rb', line 18

def initialize(type)
  self.type = type
  validate_type!
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



7
8
9
# File 'lib/fet/ui/custom_event.rb', line 7

def type
  @type
end