Sha256: f08c26aaeff280c7179a64d09852af23d1e5dcae57b3f58e2305b632f7f99e65

Contents?: true

Size: 663 Bytes

Versions: 31

Compression:

Stored size: 663 Bytes

Contents

module Fiona7
  class ComplexObject
    def initialize(obj)
      @obj = obj
    end

    def widgets
      # TODO: optimize this through attr_values
      links = @obj[:X_widget_pool] || []
      WriteObj.where(obj_id: links.map {|l| l.destination_object_id }).to_a.to_set
    end

    def binaries
      type_definition = Fiona7::TypeRegister.instance.read_mangled(@obj.obj_class)
      type_definition.attrs.each do |attribute|
        if attribute.type == :binary && attribute.real_name != "blob"
          (obj[attribute.real_name] || []).each do |link|
            referenced << link.destination_object
          end
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
infopark_fiona7-1.6.1.1.1 lib/fiona7/complex_object.rb
infopark_fiona7-1.6.1.1.0 lib/fiona7/complex_object.rb
infopark_fiona7-1.2.0.2.3 lib/fiona7/complex_object.rb
infopark_fiona7-1.2.0.2.1 lib/fiona7/complex_object.rb
infopark_fiona7-1.2.0.2.2 lib/fiona7/complex_object.rb
infopark_fiona7-1.5.5.5.1 lib/fiona7/complex_object.rb
infopark_fiona7-1.5.5.5.0 lib/fiona7/complex_object.rb
infopark_fiona7-1.2.0.1.4 lib/fiona7/complex_object.rb
infopark_fiona7-1.5.5.4.1 lib/fiona7/complex_object.rb
infopark_fiona7-1.5.5.4.0 lib/fiona7/complex_object.rb
infopark_fiona7-1.2.0.1.3 lib/fiona7/complex_object.rb
infopark_fiona7-1.5.5.3.1 lib/fiona7/complex_object.rb
infopark_fiona7-1.5.4.3.0 lib/fiona7/complex_object.rb
infopark_fiona7-1.5.3.2.0 lib/fiona7/complex_object.rb
infopark_fiona7-1.5.3.2.0.pre.beta1 lib/fiona7/complex_object.rb
infopark_fiona7-1.5.2.1.0.pre.beta1 lib/fiona7/complex_object.rb
infopark_fiona7-1.5.2.0.0 lib/fiona7/complex_object.rb
infopark_fiona7-1.2.0.1.1 lib/fiona7/complex_object.rb
infopark_fiona7-1.2.0.0.1 lib/fiona7/complex_object.rb
infopark_fiona7-1.2.0.0.0 lib/fiona7/complex_object.rb