Class: Plushie::Event::Effect

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

Defined Under Namespace

Modules: Result

Instance Attribute Summary collapse

Instance Attribute Details

#tag [Symbol] the tag from the originating effect command([Symbol]) ⇒ Object (readonly)

Effect result events for platform operations (file dialogs, clipboard, notifications). Triggered when an asynchronous platform effect completes. The tag matches the symbol passed when creating the effect command. The result field is a typed per-kind Data class from Event::Effect::Result (FileOpened, ClipboardText, Cancelled, Timeout, Error, etc.) rather than a generic tuple.

Examples:

File dialog result

in Event::Effect[tag: :import, result: Event::Effect::Result::FileOpened[path:]]

Cancelled

in Event::Effect[tag: :import, result: Event::Effect::Result::Cancelled[]]


201
# File 'lib/plushie/event.rb', line 201

Effect = Data.define(:tag, :result)