Class: Jekyll::Archimate::UnifiedModel
- Inherits:
-
Object
- Object
- Jekyll::Archimate::UnifiedModel
- Defined in:
- lib/jekyll/archimate/archimate_hook.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.
112 113 114 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 112 def initialize(model) @model = model end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
110 111 112 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 110 def model @model end |
Instance Method Details
#diagrams ⇒ Object
131 132 133 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 131 def diagrams model.diagrams.map { |diagram| DiagramEntity.new(diagram).to_h } end |
#elements ⇒ Object
123 124 125 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 123 def elements model.elements.map { |element| ElementEntity.new(element, model: model).to_h } end |
#entities ⇒ Object
135 136 137 138 139 140 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 135 def entities [ModelEntity.new(model).to_h].concat( elements).concat( relationships).concat( diagrams) end |
#folders ⇒ Object
142 143 144 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 142 def folders [Folder.new(model.organizations.last).to_h] end |
#relationships ⇒ Object
127 128 129 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 127 def relationships model.relationships.map { |relationship| RelationshipEntity.new(relationship, model: model).to_h } end |
#to_h ⇒ Object
116 117 118 119 120 121 |
# File 'lib/jekyll/archimate/archimate_hook.rb', line 116 def to_h { entities: entities, folders: folders } end |