Class: SugarCube::UIControlCallbackHelper
- Defined in:
- lib/sugarcube-events/uicontrol.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
Returns the value of attribute callback.
Instance Method Summary collapse
Instance Attribute Details
#callback ⇒ Object
Returns the value of attribute callback.
81 82 83 |
# File 'lib/sugarcube-events/uicontrol.rb', line 81 def callback @callback end |
Instance Method Details
#call(sender, event: event) ⇒ Object
83 84 85 86 87 88 89 90 91 92 |
# File 'lib/sugarcube-events/uicontrol.rb', line 83 def call(sender, event:event) case callback.arity when 0 callback.call when 1 callback.call(sender) else callback.call(sender, event) end end |