Class: Jekyll::Archimate::UnifiedModel
- Inherits:
-
Object
- Object
- Jekyll::Archimate::UnifiedModel
- Defined in:
- lib/jekyll/archimate/unified_model.rb
Overview
This is the top level object used by the web Archimate Navigator
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
- #diagrams ⇒ Object
- #elements ⇒ Object
- #entities ⇒ Object
- #folders ⇒ Object
-
#initialize(model) ⇒ UnifiedModel
constructor
A new instance of UnifiedModel.
- #relationships ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(model) ⇒ UnifiedModel
Returns a new instance of UnifiedModel.
9 10 11 |
# File 'lib/jekyll/archimate/unified_model.rb', line 9 def initialize(model) @model = model end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'lib/jekyll/archimate/unified_model.rb', line 7 def model @model end |
Instance Method Details
#diagrams ⇒ Object
28 29 30 |
# File 'lib/jekyll/archimate/unified_model.rb', line 28 def diagrams model.diagrams.map { |diagram| DiagramEntity.new(diagram).to_h } end |
#elements ⇒ Object
20 21 22 |
# File 'lib/jekyll/archimate/unified_model.rb', line 20 def elements model.elements.map { |element| ElementEntity.new(element, model: model).to_h } end |
#entities ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/jekyll/archimate/unified_model.rb', line 32 def entities [ModelEntity.new(model).to_h].concat( elements ).concat( relationships ).concat( diagrams ) end |
#folders ⇒ Object
42 43 44 |
# File 'lib/jekyll/archimate/unified_model.rb', line 42 def folders [Folder.new(model.organizations.last).to_h] end |
#relationships ⇒ Object
24 25 26 |
# File 'lib/jekyll/archimate/unified_model.rb', line 24 def relationships model.relationships.map { |relationship| RelationshipEntity.new(relationship, model: model).to_h } end |
#to_h ⇒ Object
13 14 15 16 17 18 |
# File 'lib/jekyll/archimate/unified_model.rb', line 13 def to_h { entities: entities, folders: folders } end |