Sha256: fe3a0fe098b6bb86d84106625be023d0b28ac357b334e3eebcf4803e711982f0

Contents?: true

Size: 566 Bytes

Versions: 7

Compression:

Stored size: 566 Bytes

Contents

module Fiona7
  # 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.
  class WidgetObjectIdCollector
    def initialize(attr_value)
      self.attr_value = attr_value
    end

    def call
      (attr_value || []).map do |widget_hash|
        widget_hash["destination"].try(:to_i)
      end.compact
    end

    protected
    attr_accessor :attr_value
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
infopark_fiona7-1.6.1.1.5 lib/fiona7/widget_object_id_collector.rb
infopark_fiona7-1.6.1.1.1 lib/fiona7/widget_object_id_collector.rb
infopark_fiona7-1.6.1.1.0 lib/fiona7/widget_object_id_collector.rb
infopark_fiona7-1.5.5.5.1 lib/fiona7/widget_object_id_collector.rb
infopark_fiona7-1.5.5.5.0 lib/fiona7/widget_object_id_collector.rb
infopark_fiona7-1.5.5.4.1 lib/fiona7/widget_object_id_collector.rb
infopark_fiona7-1.5.5.4.0 lib/fiona7/widget_object_id_collector.rb