Class: Wads::WidgetResult
- Inherits:
-
Object
- Object
- Wads::WidgetResult
- Defined in:
- lib/wads/widgets.rb
Overview
A result object returned from handle methods that instructs the parent widget what to do. A close_widget value of true instructs the recipient to close either the overlay window or the entire app, based on the context of the receiver. In the case of a form being submitted, the action may be “OK” and the form_data contains the information supplied by the user. WidgetResult is intentionally generic so it can support a wide variety of use cases.
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#close_widget ⇒ Object
Returns the value of attribute close_widget.
-
#form_data ⇒ Object
Returns the value of attribute form_data.
Instance Method Summary collapse
-
#initialize(close_widget = false, action = "none", form_data = nil) ⇒ WidgetResult
constructor
A new instance of WidgetResult.
Constructor Details
#initialize(close_widget = false, action = "none", form_data = nil) ⇒ WidgetResult
Returns a new instance of WidgetResult.
2117 2118 2119 2120 2121 |
# File 'lib/wads/widgets.rb', line 2117 def initialize( = false, action = "none", form_data = nil) @close_widget = @action = action @form_data = form_data end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
2114 2115 2116 |
# File 'lib/wads/widgets.rb', line 2114 def action @action end |
#close_widget ⇒ Object
Returns the value of attribute close_widget.
2113 2114 2115 |
# File 'lib/wads/widgets.rb', line 2113 def @close_widget end |
#form_data ⇒ Object
Returns the value of attribute form_data.
2115 2116 2117 |
# File 'lib/wads/widgets.rb', line 2115 def form_data @form_data end |