Class: Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/wires/core_ext/symbol.rb

Overview

Add implicit conversion of symbol into an event

Instance Method Summary collapse

Instance Method Details

#[](*args, **kwargs, &block) ⇒ Object

Create a Wires::Event from any symbol with a payload of arguments



5
6
7
# File 'lib/wires/core_ext/symbol.rb', line 5

def [](*args, **kwargs, &block)
  Wires::Event.new(*args, **kwargs, type:self, &block)
end

#to_wires_eventObject

Convert to a Wires::Event; returns an empty event with type:self



10
# File 'lib/wires/core_ext/symbol.rb', line 10

def to_wires_event; self.[]; end