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, value: theme]

Animation frame

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of System.



329
330
331
# File 'lib/plushie/event.rb', line 329

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

Instance Attribute Details

#tagObject (readonly)

Returns the value of attribute tag

Returns:

  • (Object)

    the current value of tag



328
329
330
# File 'lib/plushie/event.rb', line 328

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, value: theme]

Animation frame

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


328
329
330
331
332
# File 'lib/plushie/event.rb', line 328

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

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



328
329
330
# File 'lib/plushie/event.rb', line 328

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, value: theme]

Animation frame

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


328
329
330
331
332
# File 'lib/plushie/event.rb', line 328

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

#valueObject (readonly)

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



328
329
330
# File 'lib/plushie/event.rb', line 328

def value
  @value
end

#value [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, value: theme]

Animation frame

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


328
329
330
331
332
# File 'lib/plushie/event.rb', line 328

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