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.
77 78 79 |
# File 'lib/sugarcube-events/uicontrol.rb', line 77 def callback @callback end |
Instance Method Details
#call(sender, event: event) ⇒ Object
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/sugarcube-events/uicontrol.rb', line 79 def call(sender, event:event) case callback.arity when 0 callback.call when 1 callback.call(sender) else callback.call(sender, event) end end |