Class: Wads::WidgetResult

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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(close_widget = false, action = "none", form_data = nil)
    @close_widget = close_widget 
    @action = action 
    @form_data = form_data
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



2114
2115
2116
# File 'lib/wads/widgets.rb', line 2114

def action
  @action
end

#close_widgetObject

Returns the value of attribute close_widget.



2113
2114
2115
# File 'lib/wads/widgets.rb', line 2113

def close_widget
  @close_widget
end

#form_dataObject

Returns the value of attribute form_data.



2115
2116
2117
# File 'lib/wads/widgets.rb', line 2115

def form_data
  @form_data
end