Class: Fiona7::WidgetObjectIdCollector
- Inherits:
-
Object
- Object
- Fiona7::WidgetObjectIdCollector
- Defined in:
- lib/fiona7/widget_object_id_collector.rb
Overview
Extracts widget object IDs from a widgetlist attribute read from Fiona7::WriteObj#attr_values[]
The array contains integer IDs of the objects representing the widgets within given attr_value. For nil values it returns an empty array.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(attr_value) ⇒ WidgetObjectIdCollector
constructor
A new instance of WidgetObjectIdCollector.
Constructor Details
#initialize(attr_value) ⇒ WidgetObjectIdCollector
Returns a new instance of WidgetObjectIdCollector.
9 10 11 |
# File 'lib/fiona7/widget_object_id_collector.rb', line 9 def initialize(attr_value) self.attr_value = attr_value end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 |
# File 'lib/fiona7/widget_object_id_collector.rb', line 13 def call (attr_value || []).map do || ["destination"].try(:to_i) end.compact end |