Class: SugarCube::AlertViewDelegate
- Defined in:
- lib/sugarcube/uialertview.rb
Instance Attribute Summary collapse
-
#buttons ⇒ Object
Returns the value of attribute buttons.
-
#on_cancel ⇒ Object
Returns the value of attribute on_cancel.
-
#on_success ⇒ Object
Returns the value of attribute on_success.
Instance Method Summary collapse
Instance Attribute Details
#buttons ⇒ Object
Returns the value of attribute buttons.
59 60 61 |
# File 'lib/sugarcube/uialertview.rb', line 59 def @buttons end |
#on_cancel ⇒ Object
Returns the value of attribute on_cancel.
60 61 62 |
# File 'lib/sugarcube/uialertview.rb', line 60 def on_cancel @on_cancel end |
#on_success ⇒ Object
Returns the value of attribute on_success.
61 62 63 |
# File 'lib/sugarcube/uialertview.rb', line 61 def on_success @on_success end |
Instance Method Details
#alertView(alert, didDismissWithButtonIndex: index) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/sugarcube/uialertview.rb', line 63 def alertView(alert, didDismissWithButtonIndex:index) if index == alert.cancelButtonIndex && on_cancel on_cancel.call elsif on_success if on_success.arity == 0 on_success.call else = [index] on_success.call() end end self.send(:autorelease) end |