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.



2148
2149
2150
2151
2152
# File 'lib/wads/widgets.rb', line 2148

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.



2145
2146
2147
# File 'lib/wads/widgets.rb', line 2145

def action
  @action
end

#close_widgetObject

Returns the value of attribute close_widget.



2144
2145
2146
# File 'lib/wads/widgets.rb', line 2144

def close_widget
  @close_widget
end

#form_dataObject

Returns the value of attribute form_data.



2146
2147
2148
# File 'lib/wads/widgets.rb', line 2146

def form_data
  @form_data
end