Class: Jekyll::Archimate::ElementEntity

Inherits:
EntityBase
  • Object
show all
Defined in:
lib/jekyll/archimate/archimate_hook.rb

Overview

Represents an ArchiMate Element

Instance Attribute Summary

Attributes inherited from EntityBase

#entity, #model

Instance Method Summary collapse

Methods inherited from EntityBase

#initialize, #to_h

Constructor Details

This class inherits a constructor from Jekyll::Archimate::EntityBase

Instance Method Details

#attr_hashObject



47
48
49
50
51
52
53
54
# File 'lib/jekyll/archimate/archimate_hook.rb', line 47

def attr_hash
  super.merge(
    type: "Element",
    element_type: entity.type,
    relationships: model.relationships.select { |rel| rel.source&.id == entity.id || rel.target&.id == entity.id }.map(&:id),
    views: model.diagrams.select { |dia| dia.element_ids.include?(entity.id) }.map(&:id)
  )
end