Sha256: deed906bca82749c66eef112924464c5b8a5238934bf3efd85d5c67a44de383b

Contents?: true

Size: 1.3 KB

Versions: 33

Compression:

Stored size: 1.3 KB

Contents

module Spider; module Model
    
    class IntegratedElement < Element
        attr_accessor :owner
        
        def initialize(name, owner, integrated_element, integrated_element_element, attributes={})
            @name = name
            @owner = owner
            el = @owner.elements[integrated_element]
            @definer_model = el.model.elements[integrated_element_element].definer_model
            @integrated_element = integrated_element
            @integrated_element_element = integrated_element_element
            @attributes = ({
                :integrated => true,
                :integrated_from => el,
                :integrated_from_element => @integrated_element_element
            }).merge(attributes)
        end
        
        def integrated?
            true
        end
        
        def target_element
            @target_element ||= @owner.elements[@integrated_element].type.elements[@integrated_element_element]
        end
        
        def type
            target_element.type
        end
        
        def attributes
            target_element.attributes.merge(@attributes)
        end
        
        
        def clone
            self.class.new(@name, @owner, @integrated_element, @integrated_element_element, @attributes.clone)
        end
        
    end
    
end; end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
spiderfw-1.0.1 lib/spiderfw/model/integrated_element.rb
spiderfw-1.0.0 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.39 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.38 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.37 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.35 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.34 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.33 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.32 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.31 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.30 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.29 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.28 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.27 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.26 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.26.pre1 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.25 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.24 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.23 lib/spiderfw/model/integrated_element.rb
spiderfw-0.6.22 lib/spiderfw/model/integrated_element.rb