Class: Jekyll::Archimate::EntityBase
- Inherits:
-
Object
- Object
- Jekyll::Archimate::EntityBase
- Defined in:
- lib/jekyll/archimate/entity_base.rb
Overview
Base class for ArchiMate Entities: Model, Diagram, Element, Relationship
Direct Known Subclasses
DiagramEntity, ElementEntity, ModelEntity, RelationshipEntity
Instance Attribute Summary collapse
-
#entity ⇒ Object
readonly
Returns the value of attribute entity.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
- #attr_hash ⇒ Object
-
#initialize(entity, model: nil) ⇒ EntityBase
constructor
A new instance of EntityBase.
- #to_h ⇒ Object
Constructor Details
#initialize(entity, model: nil) ⇒ EntityBase
Returns a new instance of EntityBase.
10 11 12 13 |
# File 'lib/jekyll/archimate/entity_base.rb', line 10 def initialize(entity, model: nil) @entity = entity @model = model end |
Instance Attribute Details
#entity ⇒ Object (readonly)
Returns the value of attribute entity.
7 8 9 |
# File 'lib/jekyll/archimate/entity_base.rb', line 7 def entity @entity end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
8 9 10 |
# File 'lib/jekyll/archimate/entity_base.rb', line 8 def model @model end |
Instance Method Details
#attr_hash ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/jekyll/archimate/entity_base.rb', line 19 def attr_hash { id: entity.id, name: entity.name, documentation: entity.documentation&.to_h, properties: entity.properties.map(&:to_h) } end |
#to_h ⇒ Object
15 16 17 |
# File 'lib/jekyll/archimate/entity_base.rb', line 15 def to_h Archimate.hash_purge(attr_hash) end |