Class: Motion::Alert
- Inherits:
-
Object
- Object
- Motion::Alert
- Defined in:
- lib/project/motion_alert.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
-
#message ⇒ Object
Returns the value of attribute message.
-
#presenter ⇒ Object
Returns the value of attribute presenter.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
5 6 7 |
# File 'lib/project/motion_alert.rb', line 5 def actions @actions end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/project/motion_alert.rb', line 4 def @message end |
#presenter ⇒ Object
Returns the value of attribute presenter.
7 8 9 |
# File 'lib/project/motion_alert.rb', line 7 def presenter @presenter end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/project/motion_alert.rb', line 3 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/project/motion_alert.rb', line 6 def type @type end |
Class Method Details
.instance ⇒ Object
9 10 11 12 |
# File 'lib/project/motion_alert.rb', line 9 def self.instance Dispatch.once { @instance ||= alloc.init } @instance end |
.new(options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/project/motion_alert.rb', line 14 def self.new( = {}) instance.tap do |i| i.title = .fetch(:title, nil) i. = .fetch(:message, nil) i.type = .fetch(:type, :alert) i.presenter = .fetch(:presenter, UIApplication.sharedApplication.keyWindow.rootViewController) i.actions = Option.new end end |
Instance Method Details
#selected(index) ⇒ Object
28 29 30 |
# File 'lib/project/motion_alert.rb', line 28 def selected(index) actions[index].choose end |
#show ⇒ Object
24 25 26 |
# File 'lib/project/motion_alert.rb', line 24 def show show_as_controller || show_as_alert || show_as_action_sheet end |