Class: SugarCube::UIControlCallbackHelper
- Defined in:
- lib/sugarcube/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.
63 64 65 |
# File 'lib/sugarcube/uicontrol.rb', line 63 def callback @callback end |
Instance Method Details
#call(sender, event: event) ⇒ Object
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/sugarcube/uicontrol.rb', line 65 def call(sender, event:event) case callback.arity when 0 callback.call when 1 callback.call(sender) else callback.call(sender, event) end end |