Class: Teek::UI::EventBinding
- Inherits:
-
Data
- Object
- Data
- Teek::UI::EventBinding
- Defined in:
- lib/teek/ui/event_binding.rb
Overview
An event a node wants wired up. target is nil to bind on the
node's own widget, or a Symbol naming another node's widget - resolved
by the realizer's link pass, after every node in the whole tree has
already been created, so a target declared later in the build still
resolves correctly (the forward-reference case). subs are
App#bind substitution codes (e.g. %i[x y]) forwarded to the
handler when it fires.
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#subs ⇒ Object
readonly
Returns the value of attribute subs.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(event:, handler:, target: nil, subs: []) ⇒ EventBinding
constructor
A new instance of EventBinding.
Constructor Details
#initialize(event:, handler:, target: nil, subs: []) ⇒ EventBinding
Returns a new instance of EventBinding.
17 18 19 |
# File 'lib/teek/ui/event_binding.rb', line 17 def initialize(event:, handler:, target: nil, subs: []) super end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event
12 13 14 |
# File 'lib/teek/ui/event_binding.rb', line 12 def event @event end |
#handler ⇒ Object (readonly)
Returns the value of attribute handler
12 13 14 |
# File 'lib/teek/ui/event_binding.rb', line 12 def handler @handler end |
#subs ⇒ Object (readonly)
Returns the value of attribute subs
12 13 14 |
# File 'lib/teek/ui/event_binding.rb', line 12 def subs @subs end |
#target ⇒ Object (readonly)
Returns the value of attribute target
12 13 14 |
# File 'lib/teek/ui/event_binding.rb', line 12 def target @target end |