Class: Motion::Action
- Inherits:
-
Object
- Object
- Motion::Action
- Defined in:
- lib/project/motion_action.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#style ⇒ Object
Returns the value of attribute style.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #choose ⇒ Object
-
#initialize(options = {}) ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize(options = {}) ⇒ Action
Returns a new instance of Action.
5 6 7 8 9 |
# File 'lib/project/motion_action.rb', line 5 def initialize( = {}) self.title = .fetch(:title, nil) self.action = .fetch(:action, nil) self.style = .fetch(:style, nil) || UIAlertActionStyleDefault end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
3 4 5 |
# File 'lib/project/motion_action.rb', line 3 def action @action end |
#style ⇒ Object
Returns the value of attribute style.
3 4 5 |
# File 'lib/project/motion_action.rb', line 3 def style @style end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/project/motion_action.rb', line 3 def title @title end |
Instance Method Details
#choose ⇒ Object
11 12 13 14 15 |
# File 'lib/project/motion_action.rb', line 11 def choose if action != nil action.call end end |