Class: Plushie::Event::System

Inherits:
Data
  • Object
show all
Defined in:
lib/plushie/event.rb

Overview

System events for theme changes, animation frames, and other runtime signals. Triggered by OS-level changes or renderer lifecycle events. Subscribe via Subscription.on_theme_change or on_animation_frame.

Examples:

Theme changed

in Event::System[type: :theme_changed, data: theme]

Animation frame

in Event::System[type: :animation_frame, data: delta_ms]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, tag: nil, data: nil) ⇒ System

Returns a new instance of System.



278
279
280
# File 'lib/plushie/event.rb', line 278

def initialize(type:, tag: nil, data: nil)
  super
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



277
278
279
# File 'lib/plushie/event.rb', line 277

def data
  @data
end

#data [Object, nil] event payload (theme name for :theme_changed, delta ms for :animation_frame)([Object, nil](theme name) ⇒ Object (readonly)

System events for theme changes, animation frames, and other runtime signals. Triggered by OS-level changes or renderer lifecycle events. Subscribe via Subscription.on_theme_change or on_animation_frame.

Examples:

Theme changed

in Event::System[type: :theme_changed, data: theme]

Animation frame

in Event::System[type: :animation_frame, data: delta_ms]


277
278
279
280
281
# File 'lib/plushie/event.rb', line 277

System = Data.define(:type, :tag, :data) do
  def initialize(type:, tag: nil, data: nil)
    super
  end
end

#tagObject (readonly)

Returns the value of attribute tag

Returns:

  • (Object)

    the current value of tag



277
278
279
# File 'lib/plushie/event.rb', line 277

def tag
  @tag
end

#tag [Symbol, nil] subscription tag (for :animation_frame)([Symbol, nil]() ⇒ Object (readonly)

System events for theme changes, animation frames, and other runtime signals. Triggered by OS-level changes or renderer lifecycle events. Subscribe via Subscription.on_theme_change or on_animation_frame.

Examples:

Theme changed

in Event::System[type: :theme_changed, data: theme]

Animation frame

in Event::System[type: :animation_frame, data: delta_ms]


277
278
279
280
281
# File 'lib/plushie/event.rb', line 277

System = Data.define(:type, :tag, :data) do
  def initialize(type:, tag: nil, data: nil)
    super
  end
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



277
278
279
# File 'lib/plushie/event.rb', line 277

def type
  @type
end

#type [Symbol] :theme_changed, :animation_frame([Symbol], : animation_frame) ⇒ Object (readonly)

System events for theme changes, animation frames, and other runtime signals. Triggered by OS-level changes or renderer lifecycle events. Subscribe via Subscription.on_theme_change or on_animation_frame.

Examples:

Theme changed

in Event::System[type: :theme_changed, data: theme]

Animation frame

in Event::System[type: :animation_frame, data: delta_ms]


277
278
279
280
281
# File 'lib/plushie/event.rb', line 277

System = Data.define(:type, :tag, :data) do
  def initialize(type:, tag: nil, data: nil)
    super
  end
end