module Fiona7 # Takes a Fiona7::WriteObj as input and iterates over each # widgetlist attribute that it has. # # This is very low-level class hence it returns mangled attribute names class WidgetlistEnumerator def initialize(object) self.object = object end def each self.object.attr_values.each do |attr_name, attr_value| next unless attr_name != "X_widget_pool" next unless self.widgetlist?(object, attr_name) yield(attr_name, attr_value) end end protected attr_accessor :object def widgetlist?(object, attr_name) attr_def = object.attr_defs[attr_name] || {} type_tag = (attr_def["help_texts"]||{})["de"]||"" type_tag =~ /"widgetlist"/ end end end