Class: UnderOs::UI::Alert
- Inherits:
-
Object
- Object
- UnderOs::UI::Alert
- Includes:
- Events
- Defined in:
- lib/under_os/ui/alert.rb
Defined Under Namespace
Classes: CustomAlertView
Instance Method Summary collapse
- #hidden ⇒ Object
- #hide(animated = true) ⇒ Object
-
#initialize(options = {}) ⇒ Alert
constructor
A new instance of Alert.
- #show ⇒ Object
- #visible ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Alert
Returns a new instance of Alert.
4 5 6 7 8 9 10 |
# File 'lib/under_os/ui/alert.rb', line 4 def initialize(={}) = {message: } if .is_a?(String) self.on = .delete[:on] if [:on] @_ = CustomAlertView.alloc.initiWithOptions(self, ) @_.show unless [:show] == false end |
Instance Method Details
#hidden ⇒ Object
26 27 28 |
# File 'lib/under_os/ui/alert.rb', line 26 def hidden !visible end |
#hide(animated = true) ⇒ Object
17 18 19 20 |
# File 'lib/under_os/ui/alert.rb', line 17 def hide(animated=true) @_.dismissWithClickedButtonIndex(0, animated: animated) self end |
#show ⇒ Object
12 13 14 15 |
# File 'lib/under_os/ui/alert.rb', line 12 def show @_.show self end |
#visible ⇒ Object
22 23 24 |
# File 'lib/under_os/ui/alert.rb', line 22 def visible @_.visible end |