class UnderOs::UI::Alert

Public Class Methods

new(options={}) click to toggle source
# File lib/under_os/ui/alert.rb, line 4
def initialize(options={})
  options = {message: options}  if options.is_a?(String)
  self.on = options.delete[:on] if options[:on]

  @_ = CustomAlertView.alloc.initiWithOptions(self, options)
  @_.show unless options[:show] == false
end

Public Instance Methods

hidden() click to toggle source
# File lib/under_os/ui/alert.rb, line 26
def hidden
  !visible
end
hide(animated=true) click to toggle source
# File lib/under_os/ui/alert.rb, line 17
def hide(animated=true)
  @_.dismissWithClickedButtonIndex(0, animated: animated)
  self
end
show() click to toggle source
# File lib/under_os/ui/alert.rb, line 12
def show
  @_.show
  self
end
visible() click to toggle source
# File lib/under_os/ui/alert.rb, line 22
def visible
  @_.visible
end