Class: ButtonRow
- Inherits:
-
TextInputRow
- Object
- BaseRow
- TextInputRow
- ButtonRow
- Defined in:
- lib/project/rows/button_row.rb
Constant Summary
Constants inherited from TextInputRow
TextInputRow::EMAIL_REGEX, TextInputRow::URL_REGEX
Instance Attribute Summary collapse
-
#on_tap_callback ⇒ Object
readonly
Returns the value of attribute on_tap_callback.
Attributes inherited from TextInputRow
Attributes inherited from BaseRow
Instance Method Summary collapse
- #cell_type ⇒ Object
-
#initialize(key, options) ⇒ ButtonRow
constructor
A new instance of ButtonRow.
- #listen ⇒ Object
- #tapped(notification) ⇒ Object
- #update_cell(cell) ⇒ Object
Methods inherited from TextInputRow
#capitalize?, #did_end_editing, #setup_validation, #valid?, #validation_rules
Methods inherited from BaseRow
#cell_identifier, #dealloc, #has_value?, #notification_center, #observe, #post
Constructor Details
#initialize(key, options) ⇒ ButtonRow
Returns a new instance of ButtonRow.
7 8 9 10 11 |
# File 'lib/project/rows/button_row.rb', line 7 def initialize(key, ) super @on_tap_callback = .fetch(:action, lambda {}) end |
Instance Attribute Details
#on_tap_callback ⇒ Object (readonly)
Returns the value of attribute on_tap_callback.
5 6 7 |
# File 'lib/project/rows/button_row.rb', line 5 def on_tap_callback @on_tap_callback end |
Instance Method Details
#cell_type ⇒ Object
13 14 15 |
# File 'lib/project/rows/button_row.rb', line 13 def cell_type ButtonCell end |
#listen ⇒ Object
17 18 19 |
# File 'lib/project/rows/button_row.rb', line 17 def listen observe('FormCellWasTapped', 'tapped:') end |
#tapped(notification) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/project/rows/button_row.rb', line 21 def tapped(notification) if notification.userInfo[:key] == key post('ButtonCallbackWillFire') on_tap_callback.call end end |
#update_cell(cell) ⇒ Object
29 30 31 |
# File 'lib/project/rows/button_row.rb', line 29 def update_cell(cell) super end |