Class: SugarCube::ActionSheetDelegate
- Defined in:
- lib/sugarcube/uiactionsheet.rb
Instance Attribute Summary collapse
-
#button_index_map ⇒ Object
Returns the value of attribute button_index_map.
-
#on_cancel ⇒ Object
Returns the value of attribute on_cancel.
-
#on_destructive ⇒ Object
Returns the value of attribute on_destructive.
-
#on_success ⇒ Object
Returns the value of attribute on_success.
Instance Method Summary collapse
Instance Attribute Details
#button_index_map ⇒ Object
Returns the value of attribute button_index_map.
92 93 94 |
# File 'lib/sugarcube/uiactionsheet.rb', line 92 def @button_index_map end |
#on_cancel ⇒ Object
Returns the value of attribute on_cancel.
93 94 95 |
# File 'lib/sugarcube/uiactionsheet.rb', line 93 def on_cancel @on_cancel end |
#on_destructive ⇒ Object
Returns the value of attribute on_destructive.
94 95 96 |
# File 'lib/sugarcube/uiactionsheet.rb', line 94 def on_destructive @on_destructive end |
#on_success ⇒ Object
Returns the value of attribute on_success.
95 96 97 |
# File 'lib/sugarcube/uiactionsheet.rb', line 95 def on_success @on_success end |
Instance Method Details
#actionSheet(alert, didDismissWithButtonIndex: index) ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/sugarcube/uiactionsheet.rb', line 97 def actionSheet(alert, didDismissWithButtonIndex:index) if index == alert.destructiveButtonIndex && on_destructive on_destructive.call elsif 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 |